To capture output you need the backticks
my @output = `put your command here`;
The return value of a system call is the return value of the program you call.
See perldoc perlfaq8 for more info
Jim
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 25 May 2004
Hi all,
I have a problem with the GD module on Solaris 5.8 using Perl 5.6.1. I have installed
Perl to /usr/local/bin/perl and /usr/app/perl is a symlink to fit in with certain
conventions round here.
When compiling the GD module it asked me where libgd was installed, and I told it -
/usr/loca
-Original Message-
From: Gordon Low [mailto:[EMAIL PROTECTED]
Sent: 09 March 2004 08:29
To: [EMAIL PROTECTED]
Subject: Logical problem with small script??
Wondered if anyone can throw some light on why this script won't act
properly.
Wrote it to convert a string using a ceaser cipher f
Hi Malik,
If you pass a reference to the array as the first argument as below you can
keep the array separate from the other arguments you are passing.
@abc = qw(1 2 3);
$x = 4;
$y = 5;
testsub([EMAIL PROTECTED], $x, $y);
sub testsub($$$)
{
($abc, $x, $y) = @_;
print "Array @$abc\n";
Hi Will,
Just a couple of comments on the script you sent.
This is your script with some minor changes.
$infile = "zary_necheva_data.txt";
open(INFILE, $infile) or die "Death $!";
while( $line = ){
$lpos = index($line,"|");
# Your line will capture the first five chars, but in the sample
Hi all,
May I start by thanking all the people who have helped me in the past, and I
hope you can help me with this one.
I have a Solaris 5.8 server with a version of Perl provided as part of
Rational ClearCase, and I am getting very strange errors. Sometimes scripts
fail when use'ing Getopt::L
Have a look at Tom's Object Oriented Tutorial
man perltoot or perldoc perltoot
Jim
-Original Message-
From: Eric Walker [mailto:[EMAIL PROTECTED]
Sent: 12 September 2003 15:33
To: perlgroup
Subject: packages object oriented
Does anyone have a good hold of how to do object oriented pr
The O'Reilly series of books are very good and there are a few other books
available here http://learn.perl.org/library/
O'Reilly books include:
Learning Perl
Learning Perl on Win32 systems
Programming Perl
Perl Cookbook
Advanced Perl Programming
And don't forget your Perl distribution comes w
@ls = `la -al`;
will do it.
$ls = system("ls -al");
will save the exit status of the command, rather than the output.
Jim
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 06 April 2003 12:01
To: [EMAIL PROTECTED]
Subject: accessing the string from system("l
($a = 20) is an assignment so the if statement is testing the success of the
assignment, not a comparison - not what you want here.
Change it to ($a == 20), this will test numerically whether $a contains 20.
eq can be used for string comparisons
Jim
-Original M
Yes, I started with 'Learning Perl' as a complete novice as I'm sure many
other people have.
There are lots of well explained examples, a test yourself questions section
at the end of each chapter. Sample answers are provided and discussed in
Appendix A.
Jim
-Original Message-
From: '[
You are missing a semi-colon at the end of line 2, and remove the comma
between the filehandle and $string in line 6.
That should sort your problems.
The Perl Cookbook is one of series of books on Perl published by O'Reilly.
www.oreilly.com, generally well respected and very popular. If you sta
12 matches
Mail list logo