<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>External Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/external/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/external/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Wed, 13 Apr 2022 16:34:32 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>Getting input from users in JavaScript</title>
		<link>https://www.scmgalaxy.com/tutorials/getting-input-from-users-in-javascript/</link>
					<comments>https://www.scmgalaxy.com/tutorials/getting-input-from-users-in-javascript/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Tue, 27 Jul 2021 13:05:27 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[External]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[inline]]></category>
		<category><![CDATA[Javascript]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7107</guid>

					<description><![CDATA[<p>prompt( ) – The browser provides a built-in function that can be used to get inputfrom the user, named prompt. [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/getting-input-from-users-in-javascript/">Getting input from users in JavaScript</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">prompt( ) – The browser provides a built-in function that can be used to get input<br>from the user, named prompt. The prompt( ) method displays a dialog box that prompts<br>the visitor for input.</p>



<p class="wp-block-paragraph">Once the prompt function obtains input from the user, it returns that input.</p>



<p class="wp-block-paragraph">Syntax: &#8211; prompt(text, defaultText)</p>



<p class="wp-block-paragraph">Ex:-  prompt(“Enter Your Name: “, “name”);<br>prompt(“Enter Your Roll No. : “);</p>



<h2 class="wp-block-heading">Good Approach</h2>



<ul class="wp-block-list"><li>Inline</li><li>External</li></ul>



<h2 class="wp-block-heading">Inline</h2>



<script src="https://gist.github.com/vijaypk376/e2c6444ad3aa059fbfef5fa8e4e39772.js"></script>



<h2 class="wp-block-heading">External</h2>



<script src="https://gist.github.com/vijaypk376/e4befb317ec42b1ecde6894b3014d219.js"></script>



<h2 class="wp-block-heading">Good Approach</h2>



<ul class="wp-block-list"><li>Inside head Tag</li><li>Inside body Tag</li></ul>



<p class="wp-block-paragraph">Inside head Tag</p>



<script src="https://gist.github.com/vijaypk376/332e3a7669831841b5069f9262fe0f3b.js"></script>



<p class="wp-block-paragraph">Inside body Tag</p>



<script src="https://gist.github.com/vijaypk376/8a726555aa99262d8eab8469491b4bb6.js"></script>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/getting-input-from-users-in-javascript/">Getting input from users in JavaScript</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/getting-input-from-users-in-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How many ways are there to add JavaScript?</title>
		<link>https://www.scmgalaxy.com/tutorials/how-many-ways-are-there-to-add-javascript/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-many-ways-are-there-to-add-javascript/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Tue, 20 Jul 2021 13:01:54 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Add]]></category>
		<category><![CDATA[External]]></category>
		<category><![CDATA[inline]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[tag]]></category>
		<category><![CDATA[Ways]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=6832</guid>

					<description><![CDATA[<p>Way of adding JavaScript: Inline&#8211; Inside head Tag Inside body Tag Inside Head Tag Inside Body Tag External file Inside [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-many-ways-are-there-to-add-javascript/">How many ways are there to add JavaScript?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Way of adding JavaScript:</h2>



<h5 class="wp-block-heading"><strong>Inline</strong>&#8211;</h5>



<ul class="wp-block-list"><li>Inside head Tag</li><li>Inside body Tag</li></ul>



<h5 class="wp-block-heading">Inside Head Tag</h5>



<script src="https://gist.github.com/ajcotocus/abde139674036c2fe8b1ce1dc0451a46.js"></script>



<h5 class="wp-block-heading">Inside Body Tag</h5>



<script src="https://gist.github.com/ajcotocus/23c5d9f5b6cc6c480d51d49ef91015d8.js"></script>



<p class="wp-block-paragraph"><strong>External file</strong></p>



<ul class="wp-block-list"><li>Inside head Tag</li><li>Inside body Tag</li></ul>



<h5 class="wp-block-heading">Inside head Tag</h5>



<script src="https://gist.github.com/ajcotocus/a5548070da13985fc157b4938b010edd.js"></script>



<h5 class="wp-block-heading">Inside body Tag</h5>



<script src="https://gist.github.com/ajcotocus/cb3b3bf81e057a659c7f2b0c628fe9b7.js"></script>



<ul class="wp-block-list"><li> &lt;script> &#8211; Opening Script Tag.</li><li>src – It‟s an attribute of script tag. It defines source/location of script file.</li></ul>



<p class="wp-block-paragraph">• dev.js – This is our script file. Where dev is file name and .js is the extension<br>of javascript file.</p>



<p class="wp-block-paragraph">• type – It‟s an attribute of script tag which tells the browser it is a javascript.<br>This is optional now a days.</p>



<p class="wp-block-paragraph">• text/javascript – Its type of document</p>



<p class="wp-block-paragraph">• document.write(“Hello World”); &#8211; This is a function to display data.</p>



<p class="wp-block-paragraph">• &lt;/script> Closing Script tag</p>



<script src="https://gist.github.com/ajcotocus/7cc11d18512aa4d93f08a7029166be77.js"></script>



<script src="https://gist.github.com/ajcotocus/c52c151143f4b58956bbfc75a5cc362f.js"></script>



<h5 class="wp-block-heading"></h5>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-many-ways-are-there-to-add-javascript/">How many ways are there to add JavaScript?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/how-many-ways-are-there-to-add-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Execute external commands by using perl?</title>
		<link>https://www.scmgalaxy.com/tutorials/executing-external-commands-using-perl/</link>
					<comments>https://www.scmgalaxy.com/tutorials/executing-external-commands-using-perl/#comments</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Fri, 04 May 2012 11:02:25 +0000</pubDate>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[Execute]]></category>
		<category><![CDATA[Execute external commands]]></category>
		<category><![CDATA[Execute external commands from Perl]]></category>
		<category><![CDATA[External]]></category>
		<category><![CDATA[External commands]]></category>
		<category><![CDATA[Guide]]></category>
		<category><![CDATA[How]]></category>
		<category><![CDATA[Implement]]></category>
		<category><![CDATA[Implement external commands by using perl]]></category>
		<category><![CDATA[Perl Guide for executing external commands]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Using]]></category>
		<category><![CDATA[Ways]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2012/05/04/executing-external-commands-using-perl/</guid>

					<description><![CDATA[<p>There are many ways to execute external commands from Perl. The most commons are: system function exec function backticks (&#8220;) [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/executing-external-commands-using-perl/">How to Execute external commands by using perl?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-3828 aligncenter" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2012/05/external-commands-using-per.png" alt="execute-external-commands-from-perl" width="600" height="400" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2012/05/external-commands-using-per.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2012/05/external-commands-using-per-300x200.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></p>
<p>There are many ways to execute external commands from Perl. The most commons are:</p>
<ul type="disc">
<li><strong>system</strong> function</li>
<li><strong>exec</strong> function</li>
<li><strong>backticks (&#8220;)</strong> operator</li>
<li><strong>open</strong> function</li>
</ul>
<p>All of these methods have different behaviour, so you should choose which one to use depending of your particular need. In brief, these are the recommendations:</p>
<table border="1" cellpadding="0">
<tbody>
<tr>
<td><strong>method</strong></td>
<td><strong>use if &#8230;</strong></td>
</tr>
<tr>
<td>system()</td>
<td>you want to execute a command and don&#8217;t want to capture its output</td>
</tr>
<tr>
<td>exec</td>
<td>you don&#8217;t want to return to the calling perl script</td>
</tr>
<tr>
<td>backticks</td>
<td>you want to capture the output of the command</td>
</tr>
<tr>
<td>open</td>
<td>you want to pipe the command (as input or output) to your script</td>
</tr>
</tbody>
</table>
<p>More detailed explanations of each method follows:</p>
<p><strong>Using system() </strong><br />
system() executes the command specified. It doesn&#8217;t capture the output of the command.<br />
system() accepts as argument either a scalar or an array. If the argument is a scalar, system() uses a shell to execute the command (&#8220;/bin/sh -c command&#8221;); if the argument is an array it executes the command directly, considering the first element of the array as the command name and the remaining array elements as arguments to the command to be executed.<br />
For that reason, it&#8217;s highly recommended for efficiency and safety reasons (specially if you&#8217;re running a cgi script) that you use an array to pass arguments to system()</p>
<pre><strong>Example: </strong>     #-- calling 'command' with  arguments    system("command arg1 arg2 arg3");         #-- better way of calling the same command    system("command", "arg1", "arg2",  "arg3");     The return value  is set in <strong>$?</strong>; this value is the exit status of the command as returned  by the 'wait' call; to get the real exit status of the command you have to  shift right by 8 the value of $? ($? &gt;&gt; 8).     If the value of <strong>$?</strong> is -1, then the command failed to execute, in that case you may check the value  of <strong>$!</strong> for the reason of the failure.</pre>
<pre><strong>Example: </strong>     system("command",  "arg1");    if ( $? == -1 )    {      print "command failed: $!\n";    }    else    {      printf "command exited with value %d", $? &gt;&gt; 8;    }</pre>
<p><strong>Using exec() </strong><br />
The exec() function executes the command specified and never returns to the calling program, except in the case of failure because the specified command does not exist AND the exec argument is an array.<br />
Like in system(), is recommended to pass the arguments of the functions as an array.</p>
<p><strong>Using backticks (&#8220;) </strong><br />
In this case the command to be executed is surrounded by backticks. The command is executed and the output of the command is returned to the calling script.<br />
In scalar context it returns a single (possibly multiline) string, in list context it returns a list of lines or an empty list if the command failed.<br />
The exit status of the executed command is stored in <strong>$?</strong> (see system() above for details).</p>
<pre><strong>Example: </strong>     #-- scalar context    $result = `command arg1 arg2`;         #-- the same command in list context    @result = `command arg2 arg2`;     Notice that the  only output captured is STDOUT, to collect messages sent to STDERR you should  redirect STDERR to STDOUT</pre>
<pre><strong>Example: </strong>     #-- capture STDERR as well  as STDOUT    $result = `command 2&gt;&amp;1`;</pre>
<p><strong>Using open() </strong><br />
Use open() when you want to:<br />
&#8211; capture the data of a command (syntax: open(&#8220;command |&#8221;))<br />
&#8211; feed an external command with data generated from the Perl script (syntax: open(&#8220;| command&#8221;))</p>
<pre><strong>Examples: </strong>     #-- list the processes  running on your system    open(PS,"ps -e -o pid,stime,args |") || die "Failed: $!\n";    while ( &lt;PS&gt; )    {      #-- do something here    }         #-- send an email to user@localhost    open(MAIL, "| /bin/mailx -s test user\@localhost ") || die  "mailx failed: $!\n";  print MAIL "This is a test message";</pre>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/executing-external-commands-using-perl/">How to Execute external commands by using perl?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/executing-external-commands-using-perl/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
