[29245] in Perl-Users-Digest
Perl-Users Digest, Issue: 489 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 7 03:10:08 2007
Date: Thu, 7 Jun 2007 00:09:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 7 Jun 2007 Volume: 11 Number: 489
Today's topics:
2 examples of packages 1 has error the other does not <bpatton@ti.com>
Re: 2 examples of packages 1 has error the other does n <paduille.4061.mumia.w+nospam@earthlink.net>
Re: contacting Alfred Reibenschuh, creator of (CPAN) PD <sisyphus1@nomail.afraid.org>
Re: Help With Placeholders <bart.lateur@pandora.be>
Re: How to erase Hex value 13 from string? <bart.lateur@pandora.be>
Re: improper return value from net::ping? <bubslg@gmail.com>
LWP to fill in forms: "Cookies are not Enabled on your <kiwi509@gmail.com>
Re: Negative times in Spreadsheet::WriteExcel? jmcnamara@cpan.org
new CPAN modules on Thu Jun 7 2007 (Randal Schwartz)
Re: Re-entrant code ??? <joe@inwap.com>
Re: Search and Replace with perl <jgibson@mail.arc.nasa.gov>
System call doesn't work xlue897@rogers.com
Re: System call doesn't work <joe@inwap.com>
Re: system call <paduille.4061.mumia.w+nospam@earthlink.net>
Re: system call <joe@inwap.com>
Re: system call <joe@inwap.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 6 Jun 2007 12:40:45 -0500
From: "Billy Patton" <bpatton@ti.com>
Subject: 2 examples of packages 1 has error the other does not
Message-Id: <f46rit$nle$1@home.itg.ti.com>
I'm writing and testing a module that can be executed as a standalone script
for debugging purposes.
It's part of a very large system of regression testing. Messages are lost
along the way.
So with the caller() function I transform a module into an executable.
With example #1 my $x seems to have lost it's scope.
What I'm worried about, is what is goinf to happen when in the big system it
does a :
use foo;
or
require "foo.pm";
example #1
#!/usr/local/bin/perl
use strict;
use warnings;
if ( !defined caller ) { foo::bar();}
package foo;
my $x = 'foo.bar';
sub bar { print "$x\n"; } <<<<------ line 13 blank lines removed
1;
executing gives this :
Use of uninitialized value in concatenation (.) or string at z line 13.
example #2 works fine
#!/usr/local/bin/perl
package foo;
use strict;
use warnings;
my $x = 'foo.bar';
sub bar { print "$x\n"; }
if ( !defined caller ) {
# enter package main
package main;
use strict;
use warnings;
foo::bar();
} # leave package main
1;
------------------------------
Date: Thu, 07 Jun 2007 02:47:24 GMT
From: "Mumia W." <paduille.4061.mumia.w+nospam@earthlink.net>
Subject: Re: 2 examples of packages 1 has error the other does not
Message-Id: <0lK9i.17599$Ut6.10250@newsread1.news.pas.earthlink.net>
On 06/06/2007 12:40 PM, Billy Patton wrote:
> I'm writing and testing a module that can be executed as a standalone script
> for debugging purposes.
> It's part of a very large system of regression testing. Messages are lost
> along the way.
> So with the caller() function I transform a module into an executable.
> With example #1 my $x seems to have lost it's scope.
>
> What I'm worried about, is what is goinf to happen when in the big system it
> does a :
> use foo;
> or
> require "foo.pm";
>
> example #1
> #!/usr/local/bin/perl
> use strict;
> use warnings;
> if ( !defined caller ) { foo::bar();}
> package foo;
> my $x = 'foo.bar';
> sub bar { print "$x\n"; } <<<<------ line 13 blank lines removed
> 1;
>
> executing gives this :
> Use of uninitialized value in concatenation (.) or string at z line 13.
>
> [...]
Move the line that tests caller() and calls foo::bar() down below the
line that sets $x. Right now, when foo::bar() is invoked, $x has not
been given any value, so it's undefined.
------------------------------
Date: Thu, 7 Jun 2007 12:10:15 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: contacting Alfred Reibenschuh, creator of (CPAN) PDF-API2 ?
Message-Id: <4667690b$0$22415$afc38c87@news.optusnet.com.au>
"bugbear" <bugbear@trim_papermule.co.uk_trim> wrote in message
news:4665537c$0$8727$ed2619ec@ptn-nntp-reader02.plus.net...
> Sisyphus wrote:
>>
>>>
>>
>>
>> For this particular module, I would be clicking on the "View/Report Bugs"
>> link at:
>> http://search.cpan.org/~areibens/PDF-API2-0.61/
>> and then logging in using my PAUSE account.
>>
>> (I've never used a bitcard account. Perhaps there's a problem with
>> bitcard accounts and rt.cpan.org, though I've not heard of any.)
>
> OK. I finally got connected, and keyed in all my nice info.
>
> Having clicked on "report bug" (I forget - the OK button)
> I got a server 500 error.
>
> I used my browser to go back (to the filled in form)
> and tried a few times, separated by a few minutes.
>
Actually, I think the same might once have happened to me. I actually
checked my emails for the acknowledgement (and it was there !!) before I
tried to re-submit. I surmise that the 500 error relates not to the
submission of the report, but to something else that is supposed to happen
after the report has been received (eg an acknowledgement page, or something
like that).
> I continued to get server errors.
>
> Inevitably, of course, my email later reports I
> now have 5 job tickets open for the same bug.
.
.
Not sure what you should do here. (I'd probably just leave the dupes there
and not worry about it - after all, it's not your fault that this happened.)
One thing you could do, is take the advice at the top right corner of the
http://rt.cpan.org/Public/Dist/Display.html?Name=PDF-API2 webpage and "...
report any issues with rt.cpan.org to cpan-questions@bestpractical.com ".
You should probably mention your OS and browser - as that may be relevant to
the troubles you experienced.
Cheers,
Rob
------------------------------
Date: Wed, 06 Jun 2007 20:49:22 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Help With Placeholders
Message-Id: <t77e63p5sk8d9cgg8vok8dpaq8vecde2jt@4ax.com>
PerlGoon wrote:
>Instead I was looking for something already built into DBI that would
>maybe return the last executed query... or something built into MySQL
>that would log specific queries.
Set DBI trace?
http://search.cpan.org/perldoc?DBI#TRACING
--
Bart.
------------------------------
Date: Wed, 06 Jun 2007 20:43:16 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: How to erase Hex value 13 from string?
Message-Id: <eq6e63hatojdu20pecjj8ef42qqq47aqdm@4ax.com>
Gunnar Hjalmarsson wrote:
>Since you say that *I* missed, I have to ask: Is there a requirement to
>cover the whole problem when you try to help here?
Well, you suggested that
tr/\013//d
would solve his problem of deleting the character hex "13", which it
doesn't.
If you don't solve the whole problem, be prepared for corrections.
--
Bart.
------------------------------
Date: Wed, 06 Jun 2007 21:30:58 -0000
From: bubslg <bubslg@gmail.com>
Subject: Re: improper return value from net::ping?
Message-Id: <1181165458.269950.323490@d30g2000prg.googlegroups.com>
On Jun 6, 11:41 am, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
> bubslg wrote:
> > Help! I have a script that does a pingprobe on a list of servers. I
> > works fine with perl v5.6.1, but does not work with 5.8.8. It looks
> > like the return value from net::ping has changed. In 5.6.1 I always
> > get a return of either 1 or 0. In 5.8.8 I get a 1 or 0 with a bunch
> > of other data including the ip being pinged appended, meaning my
> > return value is alway going to be non-0. As a result a simple test
> > like
>
> > use Net::Ping;
> > my $p = Net::Ping->new("icmp");
> > print $p->ping("somehost");
> > $p->close();
>
> > is never going to work. Why the change in the return value, and how
> > do I fix it?
>
> In the latest version of Net::Ping, what the ping() method returns is
> context dependent.
>
> perldoc Net::Ping
>
> Evaluate ping() in scalar context:
>
> print scalar $p->ping("somehost");
>
> --
> Gunnar Hjalmarsson
> Email:http://www.gunnar.cc/cgi-bin/contact.pl- Hide quoted text -
>
> - Show quoted text -
Thanks Gunnar! That did the trick!
------------------------------
Date: Wed, 06 Jun 2007 21:47:18 -0700
From: Kyri <kiwi509@gmail.com>
Subject: LWP to fill in forms: "Cookies are not Enabled on your Browser"
Message-Id: <1181191638.526356.228490@n4g2000hsb.googlegroups.com>
Hi Everyone,
I'm writing a program that fills in the username and password field on
www.facebook.com/login.php and hits submit.
The forms fill out correctly and the button is hit correctly.
However, I get an error page when my program tries to log in. It has
the message:
"Cookies are not enabled on your browser. Please adjust this in your
security preferences before continuing."
Here is that portion of my code:
# Author: Kyri Baker
# 2007/06/05
use Tk;
use LWP;
use HTTP::Cookies;
use POSIX;
use strict;
require Tk::DialogBox;
require LWP::UserAgent;
my $ua = LWP::UserAgent->new;
$ua->cookie_jar( HTTP::Cookies->new() );
$ua->timeout(10);
$ua->env_proxy;
$ua->agent('Mozilla/5.0');
my $email='kiwi509@gmail.com';
my $pass='MY_PASSWORD';
my $action = 'Login';
my $response = $ua->post('http://www.facebook.com/login.php',['email'=>
$email, 'pass'=>$pass, 'doquicklogin'=>$action]);
print $response->content;
--------
Any input at all would be great, I'm just getting into Perl. :c)
------------------------------
Date: Wed, 06 Jun 2007 15:52:24 -0700
From: jmcnamara@cpan.org
Subject: Re: Negative times in Spreadsheet::WriteExcel?
Message-Id: <1181170344.972456.173600@q19g2000prn.googlegroups.com>
On Jun 5, 12:49 pm, Josef Moellers <josef.moell...@fujitsu-
siemens.com> wrote:
> Hi,
>
> I'm trying to record time differences in an Excel spreadsheet, but I'm
> unable to do this for negative differences:
Hi,
By default, Excel doesn't allow you to use negative times. You can see
some information about this here:
http://www.google.com/search?hl=en&q=excel+negative+time
One of the workarounds suggested in those links is to use the 1904
time epoch in Excel. Here is a Spreadsheet::WriteExcel example:
use strict;
use warnings;
use Spreadsheet::WriteExcel;
my $workbook = Spreadsheet::WriteExcel->new('timediff.xls');
# Use 1904 date epoch.
$workbook->set_1904();
my $HHMM = $workbook->add_format(
font => 'Arial',
size => 10,
num_format => 'hh:mm',
align => 'center',
border => 1,
);
my $worksheet = $workbook->add_worksheet('May');
my $diff = 10;
# Convert the minutes into a fraction of 24 hours
my $hhmm = $diff / 60 / 24;
$worksheet->write(0, 0, $hhmm, $HHMM);
$worksheet->write(1, 0, -$hhmm, $HHMM);
$workbook->close();
For further questions see the Spreadsheet::WriteExcel group:
http://groups.google.com/group/spreadsheet-writeexcel
John.
--
------------------------------
Date: Thu, 7 Jun 2007 04:42:10 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Thu Jun 7 2007
Message-Id: <JJ912A.1FsG@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
Catalyst-Component-InstancePerContext-0.001000
http://search.cpan.org/~groditi/Catalyst-Component-InstancePerContext-0.001000/
Return a new instance a component on each request
----
Config-Model-0.610
http://search.cpan.org/~ddumont/Config-Model-0.610/
Model to create configuration validation tool
----
File-DirCompare-0.2.1
http://search.cpan.org/~gavinc/File-DirCompare-0.2.1/
Perl module to compare two directories using callbacks.
----
File-DirCompare-0.3
http://search.cpan.org/~gavinc/File-DirCompare-0.3/
Perl module to compare two directories using callbacks.
----
File-LocalizeNewlines-1.08
http://search.cpan.org/~adamk/File-LocalizeNewlines-1.08/
Localize the newlines for one or more files
----
Games-Sudoku-Solver-v1.0.0
http://search.cpan.org/~mehner/Games-Sudoku-Solver-v1.0.0/
Solve 9x9-Sudokus recursively.
----
HTML-Menu-TreeView-0.6.5
http://search.cpan.org/~lze/HTML-Menu-TreeView-0.6.5/
----
IO-Socket-SSL-1.07
http://search.cpan.org/~sullr/IO-Socket-SSL-1.07/
Nearly transparent SSL encapsulation for IO::Socket::INET.
----
JSON-XS-1.23
http://search.cpan.org/~mlehmann/JSON-XS-1.23/
JSON serialising/deserialising, done correctly and fast
----
Locale-Memories-0.01
http://search.cpan.org/~xern/Locale-Memories-0.01/
L10N Message Retrieval
----
Locale-Memories-0.02
http://search.cpan.org/~xern/Locale-Memories-0.02/
L10N Message Retrieval
----
Memoize-Attrs-0.00_03
http://search.cpan.org/~ferreira/Memoize-Attrs-0.00_03/
Add memoization with subroutine attributes
----
Net-Analysis-0.40
http://search.cpan.org/~worrall/Net-Analysis-0.40/
Modules for analysing network traffic
----
Net-Flickr-Backup-2.97
http://search.cpan.org/~ascope/Net-Flickr-Backup-2.97/
OOP for backing up your Flickr photos locally
----
NetAddr-IP-4.007
http://search.cpan.org/~luismunoz/NetAddr-IP-4.007/
Manages IPv4 and IPv6 addresses and subnets
----
Params-Check-Faster-0.01
http://search.cpan.org/~dams/Params-Check-Faster-0.01/
A generic input parsing/checking mechanism. Reimplementation of Params::Check.
----
SVN-Access-0.02
http://search.cpan.org/~mgregoro/SVN-Access-0.02/
Perl extension to manipulate SVN Access files
----
Sort-Key-Radix-0.11
http://search.cpan.org/~salva/Sort-Key-Radix-0.11/
Radix sort implementation in XS
----
Sort-Key-Radix-0.12
http://search.cpan.org/~salva/Sort-Key-Radix-0.12/
Radix sort implementation in XS
----
Test-WWW-Selenium-1.13
http://search.cpan.org/~lukec/Test-WWW-Selenium-1.13/
Test applications using Selenium Remote Control
----
Test.php-0.02
http://search.cpan.org/~avar/Test.php-0.02/
TAP test framework for PHP with a Test::More-like interface
----
Test.php-0.03
http://search.cpan.org/~avar/Test.php-0.03/
TAP test framework for PHP with a Test::More-like interface
----
Test.php-0.04
http://search.cpan.org/~avar/Test.php-0.04/
TAP test framework for PHP with a Test::More-like interface
----
Text-XmlMatch-1.0005
http://search.cpan.org/~leeja/Text-XmlMatch-1.0005/
Pattern-matching and grouping via XML configuration file
----
Text-XmlMatch-1.0006
http://search.cpan.org/~leeja/Text-XmlMatch-1.0006/
Pattern-matching and grouping via XML configuration file
----
WWW-Wow-RealmStatus-0.5
http://search.cpan.org/~sock/WWW-Wow-RealmStatus-0.5/
The great new WWW::Wow::RealmStatus!
----
XML-Compile-0.18
http://search.cpan.org/~markov/XML-Compile-0.18/
Compilation based XML processing
----
YAML-LibYAML-0.17
http://search.cpan.org/~ingy/YAML-LibYAML-0.17/
LibYAML bindings for Perl
----
chklinks-3.03
http://search.cpan.org/~imacat/chklinks-3.03/
A non-threaded Perl link checker
----
chklinks-3.04
http://search.cpan.org/~imacat/chklinks-3.04/
A non-threaded Perl link checker
----
chklinks-3.05
http://search.cpan.org/~imacat/chklinks-3.05/
A non-threaded Perl link checker
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Wed, 06 Jun 2007 22:59:21 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: Re-entrant code ???
Message-Id: <UOqdnZQzhokiA_rbnZ2dnUVZ_qOpnZ2d@comcast.com>
tyjb wrote:
> system("perl ojob.pl");
The system() call returns a single value: 0 for success and nonzero if
the other program returned some sort of error.
When ojob.pl invoked via system(), it can _NOT_ affect any variables in the
parent program. That's not how values are passed from one script to another.
Looks to me that you haven't learned the difference between
$string_value = `perl ojob.pl`;
@array_values = `perl ojob.pl`;
$error_code = system 'perl ojob.pl';
and
@data = do "ojob.pl";
Look into "do" and how to use modules.
-Joe
------------------------------
Date: Wed, 06 Jun 2007 16:25:06 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: Search and Replace with perl
Message-Id: <060620071625066244%jgibson@mail.arc.nasa.gov>
In article <060620070935262574%jgibson@mail.arc.nasa.gov>, Jim Gibson
<jgibson@mail.arc.nasa.gov> wrote:
> If so, you can do this with a simple substitution (untested):
>
> if( $line =~ /_RWSTD_VALUE_ALLOC\(.*,\s*$/ ) {
> $line .= '*this,';
> }
That, of course, is not a "simple substitution", it is a "string
concatenation after a regular expression match". Sigh.
--
Jim Gibson
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
------------------------------
Date: Wed, 06 Jun 2007 14:11:02 -0700
From: xlue897@rogers.com
Subject: System call doesn't work
Message-Id: <1181164262.777607.283020@d30g2000prg.googlegroups.com>
Hi, All:
I have the following perl code intending to open several files using
vi. But it doesn't work.
ls test* | perl -n -e 'chomp; $cmd="vi $_"; unless(system($cmd))
{ print "success\n";}'
it reports error like:
"Input read error
success
"
Thanks for your help.
Steven
------------------------------
Date: Wed, 06 Jun 2007 15:29:44 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: System call doesn't work
Message-Id: <ef-dnR47HL79qPrbnZ2dnUVZ_oernZ2d@comcast.com>
xlue897@rogers.com wrote:
> Hi, All:
>
>
> I have the following perl code intending to open several files using
> vi. But it doesn't work.
>
>
> ls test* | perl -n -e 'chomp; $cmd="vi $_"; unless(system($cmd))
> { print "success\n";}'
You're calling 'vi' with STDIN still connected to the pipe from 'ls'.
perl -le 'print system("vi $_") ? "error ".$?>>8 : "OK" for @ARGV' *.pl
-Joe
------------------------------
Date: Wed, 06 Jun 2007 21:14:00 GMT
From: "Mumia W." <paduille.4061.mumia.w+nospam@earthlink.net>
Subject: Re: system call
Message-Id: <ssF9i.18785$j63.1458@newsread2.news.pas.earthlink.net>
On 06/06/2007 07:30 AM, hendedav@gmail.com wrote:
> On Jun 5, 3:11 pm, hende...@gmail.com wrote:
>> On Jun 5, 2:57 pm, Jim Gibson <jgib...@mail.arc.nasa.gov> wrote:
>>
>>
>>
>>> In article <1181066594.594834.6...@g4g2000hsf.googlegroups.com>,
>>> <hende...@gmail.com> wrote:
>>>> Gang,
>>>> I am using a cgi to call a pl script and then pass xml back to
>>>> the web browser (code listed below). The problem I am having is that
>>>> the code in the cgi executes promptly and as it should, but the return
>>>> values, for some reason, don't get sent to the browser until the pl
>>>> script is completed. Currently the pl script accepts two parameters
>>>> (but does nothing with the first one currently) and just uses a while
>>>> loop that counts to the 2nd passed value. If anyone can help with
>>>> this (or knows a better way to get the pid, please let me know.
>>>> Dave
>>>> $_ = param('runnow'); # passed variable value
>>>> if (system("./backup.pl \"$_\" 30 \&") == 0) {
>>>> $_ = `ps aux|grep "backup.pl $_" 2>&1`; # finds the pid of the
>>>> pl
>>>> my ($pid) = /(\d{3,})/; # isolates the pid only
>>>> chomp($pid);
>>> Unnecessary, as $pid will contain only decimal digits.
>>>> my @info = stat("/tmp/buj$pid"); # this file is created by the pl
>>>> script
>>>> print "Content-type: text/xml\n\n\n";
>>>> print "<info pid=\"". $pid ."\" date=\"". scalar(localtime) ."\" /
>>>>> ";
>>>> }
>>> Where is the while loop you described? Are you describing one program
>>> and posting another?
>>> In any case, what happens after your Perl program emits output is up to
>>> your web server and the client's browser. It is not under Perl's
>>> control. However, you can maybe help things to move along more quickly
>>> by flushing the output. See 'perldoc -q flush' for details.
>>> Posted Via Usenet.com Premium Usenet Newsgroup Services
>>> ----------------------------------------------------------
>>> ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
>>> ----------------------------------------------------------
>>> http://www.usenet.com
>> Thanks for the reply. The while loop is stored in the pl file (listed
>> below). But if perl sends the xml listed above and exists immediately
>> after, why would the browser not process it? Since the system call
>> has an appended & at the end to indicate to run as a seperate process,
>> the browser shouldn't be waiting on perl to finish that additional
>> script call, right?
>>
>> entire contents of the test.pl script:
>> ----------------------------------------
>> #!/usr/bin/perl -w
>>
>> my $test = $ARGV[0];
>> my $duration = $ARGV[1];
>>
>> $_ = `ps aux|grep "test.pl $test" 2>&1`;
>> my ($pid) = /(\d{3,})/;
>> chomp($pid);
>> open(TMP, ">/tmp/buj$pid") || die "Can't create: $!\n";
>> close(TMP);
>>
>> my $i=0;
>> while ($i<$duration) {
>> sleep(1);
>> $i++;}
>>
>> unlink "/tmp/buj$pid"; # erase the /tmp/bujPID file
>
>
>
> Can anyone else offer any advice or solutions to this problem? Or
> does anyone know a better way to find the pid of a running perl
> program?
>
> Thanks,
> Dave
>
$$ gives you the pid of your currently running CGI program. To get the
pid for the .pl file that you launch, you can use the open() command to
launch it. When you use open to open a pipe, open() returns the pid of
the process created. Read "perldoc -f open"
For example, see this:
--------------async.cgi----------------
#!/usr/bin/perl
use strict;
use warnings;
$| = 1;
my $script = 'async.pl &';
print "Content-Type: text/plain\n\n";
my $pid = open(my $fh, '-|', $script) or die("Open failure for $script:
$!");
my $date = localtime;
print qq{<info pid="$pid" date="$date" cgi_pid="$$">\n};
close $fh;
--------------end----------------------
----------------async.pl----------------
#!/usr/bin/perl
use strict;
use warnings;
print "Async.pl($0) running\n";
sleep 10;
----------------end----------------------
------------------------------
Date: Wed, 06 Jun 2007 22:41:28 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: system call
Message-Id: <FO6dnTyma-EPB_rbnZ2dnUVZ_tmknZ2d@comcast.com>
hendedav@gmail.com wrote:
>>> if (system("./backup.pl \"$_\" 30 \&") == 0) {
> Since the system call
> has an appended & at the end to indicate to run as a seperate process,
> the browser shouldn't be waiting on perl to finish that additional
> script call, right?
Using "&" alone is insufficient, since STDIN, STDOUT, and STDERR are
still being held open by the backgrounded task.
$log_file = '/dev/null'
if (system qq(./backup.pl "$_" 30 </dev/null >>$log_file 2>&1 &) == 0 {
-Joe
------------------------------
Date: Wed, 06 Jun 2007 22:46:00 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: system call
Message-Id: <FO6dnT-ma-EDBvrbnZ2dnUVZ_tninZ2d@comcast.com>
At 7:32am xlue897@rogers.com wrote:
> I have the following perl code intending to open several files using
> vi. But it doesn't work.
See answer to same question posted at 2:11pm.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 489
**************************************