<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1001009" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1001009</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/offline-mode-enter-namevalue-pairs#comment-1004280</link>
    <description> &lt;p&gt;Hmm just relooked over the script.&lt;br /&gt;
&amp;lt;&amp;lt;$mytest =$q-&amp;gt;param(mytest);&amp;gt;&amp;gt;&lt;/p&gt;
&lt;p&gt;Couldn&#039;t I simply comment this line out, as it seems not to be needed ??&lt;/p&gt;
&lt;p&gt;------------------&lt;br /&gt;
Meta-Saerch ?&lt;br /&gt;
&lt;a href=&quot;http://www.waatleeft.lu&quot; title=&quot;http://www.waatleeft.lu&quot;&gt;http://www.waatleeft.lu&lt;/a&gt;&lt;/p&gt;
 </description>
     <pubDate>Mon, 06 Mar 2000 10:01:00 +0000</pubDate>
 <dc:creator>ThierryZ</dc:creator>
 <guid isPermaLink="false">comment 1004280 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/offline-mode-enter-namevalue-pairs#comment-1004279</link>
    <description> &lt;p&gt;First I&#039;d like thank you for the complete and helpfull answer.&lt;/p&gt;
&lt;p&gt;Neitherway I am no expert at perl, this is how I tried to run it :&lt;/p&gt;
&lt;p&gt;I entered this line in the crontab&lt;br /&gt;
*/2 * * * * perl /home/waatleef/public_html/cgi-bin/newsg/wortcron.pl name=value&lt;/p&gt;
&lt;p&gt;So this should run wortcron.pl every 2 minutes,  but it does not not.&lt;/p&gt;
&lt;p&gt;If I go into the dir /home/waatleef/public_html/cgi-bin/newsg/&lt;br /&gt;
and run &quot;perl wortcron.pl name=value&quot; ; everything wents fine. (the files get&#039;s printed,though the &quot;variable&quot; does not exist)&lt;/p&gt;
&lt;p&gt;Yeah I used &quot;name=value&quot; but it works if used in the same dir, if call from behond home, it doesn&#039;t ?&lt;/p&gt;
&lt;p&gt;------------------&lt;br /&gt;
Meta-Saerch ?&lt;br /&gt;
&lt;a href=&quot;http://www.waatleeft.lu&quot; title=&quot;http://www.waatleeft.lu&quot;&gt;http://www.waatleeft.lu&lt;/a&gt;&lt;/p&gt;
 </description>
     <pubDate>Mon, 06 Mar 2000 09:59:00 +0000</pubDate>
 <dc:creator>ThierryZ</dc:creator>
 <guid isPermaLink="false">comment 1004279 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/offline-mode-enter-namevalue-pairs#comment-1004278</link>
    <description> &lt;p&gt;command line arguments get shoved into @ARGV, but in this case, you&#039;d have to do &#039;addin mytest=whatever&#039; because you&#039;re trying to get the parameter &#039;mytest&#039; from the browser.  variable isn&#039;t the right word for it, but it seemed like a simple way to describe it.  you can pass parameters to a perl script.  when doing it with a browser, you usually do script.cgi?node=blah, where the parameter&#039;s name is &#039;node&#039; and its value is &#039;blah&#039;.  when you run the script on the command line, you can&#039;t do &#039;script.cgi?node=blah&#039;, so you must do &#039;script.cgi node=blah&#039; and perl figures out that that is the parameter.  in a sense, when you do &#039;script.cgi?node=blah&#039; that is the argument for the script, but since you&#039;re using param($param_name), it figures out that the list of $param=$value pairs gets separated and uses $param as the parameter name and $value as that parameter&#039;s value.  thus going to &#039;http://blah.com/script.cgi?node=blah&amp;amp;test=sure&amp;amp;blah=why_not&#039; (which is the same as running &#039;script.cgi node=blah test=sure halb=why_not&#039; on the command line) ends up with three parameters that you pass in: node, test, and halb, along with the three (respective) values for those parameters: blah, sure, and why_not.  you&#039;re using param() from CGI.pm which simplifies this because otherwise you&#039;d need to check @ARGV to see if there were any valid parameters passed (in the form $param=$value) to the script, and make sure that it all fit, and it gets all complicated and messy and using CGI.pm is just loads easier.&lt;/p&gt;
 </description>
     <pubDate>Sun, 05 Mar 2000 18:17:00 +0000</pubDate>
 <dc:creator>roBofh</dc:creator>
 <guid isPermaLink="false">comment 1004278 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/offline-mode-enter-namevalue-pairs#comment-1004275</link>
    <description> &lt;p&gt;Where you normally enter variables through script.cgi?variable=value, when you run it in offline mode, you need to specify those variables on the command line, e.g. &#039;script.cgi variable=value&#039;&lt;/p&gt;
&lt;p&gt;-rob&lt;/p&gt;
 </description>
     <pubDate>Sun, 05 Mar 2000 13:31:00 +0000</pubDate>
 <dc:creator>roBofh</dc:creator>
 <guid isPermaLink="false">comment 1004275 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/offline-mode-enter-namevalue-pairs#comment-1004274</link>
    <description> &lt;p&gt;This is the CronMessage (to my mail)  I get once I let that script run through Cron. (offline mode: enter name=value pairs on standard input)&lt;/p&gt;
&lt;p&gt;The script :&lt;/p&gt;
&lt;p&gt;#!/usr/bin/perl&lt;br /&gt;
use English;&lt;br /&gt;
use CGI;&lt;br /&gt;
use integer;&lt;br /&gt;
require LWP::UserAgent;&lt;/p&gt;
&lt;p&gt;$q = new CGI;&lt;br /&gt;
#print $q-&amp;gt;header;&lt;br /&gt;
$mytest =$q-&amp;gt;param(mytest);&lt;/p&gt;
&lt;p&gt;$ssi = &quot;no&quot;;&lt;br /&gt;
$ua = new LWP::UserAgent;&lt;br /&gt;
$the_cgi = CGI-&amp;gt;new;&lt;br /&gt;
$domain = &quot;www.wort.lu/w_aktu/default.htm&quot;;&lt;br /&gt;
#$domain = $ENV{&#039;QUERY_STRING&#039;}; # ex. &quot;script.cgi?yahoo.com&quot;;&lt;br /&gt;
$begin = &quot;http://&quot;;&lt;br /&gt;
$data = $begin . $domain;&lt;br /&gt;
$breakupa = &quot;&amp;lt;A HREF=\&quot;/w_ak&quot;; # If this string is in a line, that line will be printed.&lt;br /&gt;
$breakupb = &quot;&amp;lt;/A&amp;gt;&quot;; # If this string is in a line, that line will be printed.&lt;br /&gt;
$breakupc = &quot;&amp;lt;IMG BORDER=0&quot;; # If this string is in a line, that line will be printed.&lt;/p&gt;
&lt;p&gt;$replacea = &quot;&amp;lt;A HREF=\&quot;/w_aktu/&quot;;&lt;br /&gt;
$replaceb = &quot;&amp;lt;font face=\&quot;Arial, Helvetica, sans-serif\&quot; size=\&quot;1\&quot;&amp;gt;&amp;lt;A HREF=\&quot;http://www.wort.lu/w_aktu/&quot;;&lt;br /&gt;
$replacec = &quot;&amp;lt;/A&amp;gt;&quot;;&lt;br /&gt;
$replaced = &quot;&amp;lt;/A&amp;gt;&amp;lt;BR&amp;gt;&quot;;&lt;br /&gt;
$replacee = &quot;&amp;lt;BR&amp;gt;&amp;lt;/A&amp;gt;&amp;lt;BR&amp;gt;&quot;;&lt;br /&gt;
$replacef = &quot;&amp;lt;/A&amp;gt;&quot;;&lt;/p&gt;
&lt;p&gt;$numheads = &quot;900&quot;; # Number of headlines you want to be printed Times Three!&lt;br /&gt;
$footer = &quot;&quot;;&lt;br /&gt;
$lookup = new HTTP::Request &#039;GET&#039;, &quot;$data&quot;;&lt;br /&gt;
$response = $ua-&amp;gt;request($lookup);&lt;br /&gt;
@lines = split (/\n/, $response-&amp;gt;content);&lt;/p&gt;
&lt;p&gt;$logpath = &quot;../../wort2.txt&quot;;&lt;br /&gt;
open (LOG, &quot;&amp;gt;$logpath&quot;);&lt;/p&gt;
&lt;p&gt;$i = 0;&lt;br /&gt;
foreach $line (@lines)&lt;br /&gt;
  {&lt;br /&gt;
     if ($line =~ /$breakupc/ &amp;amp;&amp;amp; $i &amp;lt; $numheads)&lt;br /&gt;
      {&lt;br /&gt;
	$i += 1;&lt;br /&gt;
      }&lt;br /&gt;
     elsif ($line =~ /$breakupa/ &amp;amp;&amp;amp; $i &amp;lt; $numheads)&lt;br /&gt;
      {&lt;br /&gt;
	$line =~ s/$replacea/$replaceb/;&lt;/p&gt;
&lt;p&gt;	print LOG &quot;$line&quot;;&lt;br /&gt;
	$i += 1;&lt;br /&gt;
      }&lt;br /&gt;
     elsif ($line =~ /$breakupb/ &amp;amp;&amp;amp; $i &amp;lt; $numheads)&lt;br /&gt;
	{&lt;br /&gt;
	$line =~ s/$replacec/$replaced/;&lt;br /&gt;
	$line =~ s/$replacee/$replacef/;&lt;br /&gt;
	print LOG &quot;$line&quot;;&lt;br /&gt;
	$i += 1;&lt;/p&gt;
&lt;p&gt;	}&lt;br /&gt;
  }&lt;br /&gt;
exit;&lt;br /&gt;
close(LOG);&lt;/p&gt;
&lt;p&gt;.........&lt;/p&gt;
&lt;p&gt;It parses through html then writes to an File. If I run it manually (from my browser) it does work,  but from cron it just generates that error message. &lt;/p&gt;
&lt;p&gt;Anybody can help ?&lt;/p&gt;
&lt;p&gt;------------------&lt;br /&gt;
Meta-Saerch ?&lt;br /&gt;
&lt;a href=&quot;http://www.waatleeft.lu&quot; title=&quot;http://www.waatleeft.lu&quot;&gt;http://www.waatleeft.lu&lt;/a&gt;&lt;/p&gt;
 </description>
     <pubDate>Sun, 05 Mar 2000 10:06:00 +0000</pubDate>
 <dc:creator>ThierryZ</dc:creator>
 <guid isPermaLink="false">comment 1004274 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/offline-mode-enter-namevalue-pairs#comment-1004277</link>
    <description> &lt;p&gt;Possibly something for the module, but i doubt it. isn&#039;t command line arguments supposed to be $ARG[0] ?&lt;/p&gt;
 </description>
     <pubDate>Sun, 05 Mar 2000 05:39:00 +0000</pubDate>
 <dc:creator>Orpheus</dc:creator>
 <guid isPermaLink="false">comment 1004277 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
