[8138] in Perl-Users-Digest
Perl-Users Digest, Issue: 1756 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 29 01:07:29 1998
Date: Wed, 28 Jan 98 22:00:21 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 28 Jan 1998 Volume: 8 Number: 1756
Today's topics:
Re: cgi file saving problem... (brian d foy)
delete function <jwhite@thegrid.net>
Re: email address <*@qz.to>
Re: HELP HELP HELP!!! - with function call parameters (Martien Verbruggen)
Re: help needed with varaible in a pattern (Martien Verbruggen)
Re: help needed with varaible in a pattern (Martien Verbruggen)
module variable scope <twaung@networkgen.com>
Re: module variable scope (brian d foy)
Re: multiple single line match (Clay Irving)
Re: multiple single line match <markm@nortel.ca>
Re: Odd syntax problem <rjk@coos.dartmouth.edu>
Re: PERL5x4x4 fails on 'make' (Martien Verbruggen)
Re: Problem with typeglob <joseph@5sigma.com>
Re: regexes: fun with /x <rjk@coos.dartmouth.edu>
Re: Regular expression help.... <*@qz.to>
RPMs for 5.004-4 <bowker@earthlink.net>
Re: Some Questions Regarding Error Messages Generated b <vallon@pearl.fi.bear.com>
Re: Split <markm@nortel.ca>
Text Problems With Explorer 4.0 (A.E. Halpin)
Re: under what shell system(...) runs the unix command? <vallon@pearl.fi.bear.com>
Re: UNIX to Win: Script *Still* Won't Go (Martien Verbruggen)
Re: unzip utility for alpha NT? (PaulJCase)
Why can't I unzip? (PaulJCase)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 28 Jan 1998 22:20:05 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: cgi file saving problem...
Message-Id: <comdog-ya02408000R2801982220050001@news.panix.com>
Keywords: from just another new york perl hacker
In article <6aop4a$jes@news1.infoave.net>, mahubbar@mail.vt.edu (Quasimodo) posted:
>$char_file =
>"http://www.geeksusa.com/mahubbar/characters/".$unique.".html";
this isn't even wrong... what are you trying to do?
>open (DUMMY, ">$char_file");
you didn't check the return value of that open...
>This is mostly gleened from examples, so I'm probibly completely off
>the mark here...
run far away from where-ever you found those examples.
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
------------------------------
Date: Wed, 28 Jan 1998 19:23:31 -0800
From: Justin <jwhite@thegrid.net>
Subject: delete function
Message-Id: <34CFF632.4893EAAD@thegrid.net>
Hi,
I'm having a hard time understanding the delete function in perl. Some
of the scripts that I have running on a BSDI machine require that I
delete certain lines of a file. It seems that the delete function only
likes to delete a specified key and associated value from a specified
hash. If I have a file full of tilde delimited text, do I have to dump
all of it into an associative array? It seems like it should be easier
than that, so I figured I'd post a question here in hopes that someone
might point out what I'm overlooking.
Thanks,
Justin
------------------------------
Date: 29 Jan 1998 04:18:48 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: email address
Message-Id: <qz$9801282252@qz.little-neck.ny.us>
Posted and mailed (from a valid address).
In article <34CF3C3C.41C6@meta3.com>, Ken Holm <rets@meta3.com> wrote:
> Following is a non-optimal function that returns true or false for an
^^^^^^^^^^^
Very.
> email passed to it. This certainly is not fool proof but works well
> enough to use:
I doubt it.
> return (0) unless $Item;
"0" is a reasonable local email address.
> my ($user, $domain) = split(/\@/, $Item);
"@alpha.netusa.net:eli@mail.netusa.net" is a valid address for me.
> return (0) unless ($user && $domain);
"0@qz.little-neck.ny.us" is a valid address for me.
> return (0) if ($domain !~ /\./);
It is legal to have an MX record for a top level domain.
> foreach $Section ($user, $domain) {
> @List = split(/\./, $Section);
> for (@List) {
> return (0) if $_ =~ /\W/;
"_" is not legal in a domain name (under current internet rules, intranets
can do as they please). <foo@...> is not valid, but this would not notice.
"-" is legal in the local part and the domain name. In my experience - +
/ = . and ' are not uncommon in the local part. Many other things are also
legal.
echo ping | sendmail '<"echo; rm -rf / ;request"@qz.to>'
Go ahead, try it. (Be careful if you don't use sendmail, some mailers have
a bug that will cause the rm to be executed on *your* machine.)
Elijah
------
<URL:http://www.qz.to/~eli/faqs/addressing.html>
------------------------------
Date: 29 Jan 1998 03:25:38 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: HELP HELP HELP!!! - with function call parameters
Message-Id: <6aosri$l70$3@comdyn.comdyn.com.au>
In article <01bd2c1b$47e63410$a8fbbdce@alis-pc>,
"alis" <alis@ssd.fsi.com> writes:
> sub travlink
> {
> local ($lnode)=@_;
> open(somefile....); I am assuming this is somefile3. right?
Especially when your code is an example, you should check the return
value of open().
This will generate syntax errors.
> print somefile3 $lnode;
> }
This is not functionally different from what the original poster
submitted. The only difference is that the original function always
returns 1, and yours returns whatever print returns. So how would this
solve the problem?
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au |
Commercial Dynamics Pty. Ltd. | Curiouser and curiouser, said Alice.
NSW, Australia |
------------------------------
Date: 29 Jan 1998 03:13:28 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: help needed with varaible in a pattern
Message-Id: <6aos4o$l70$1@comdyn.comdyn.com.au>
In article <34d29565.24052618@news.cmc.ec.gc.ca>,
sjuneau@microtec.net (Sylvain Juneau) writes:
Did you run perl with -w? I don't think so.
Did you use strict? no.
You really should have done both of the above.
> @client_prod_list=();
> open(CLIENTCONF, "client_conf_file")|| die "Can't open:$!\n";
> while(<CLIENTCONF>)
> {
> next if(/^#/);
> push @client_prod_list, /(\w+)\./;
> push @client_prod_list1, /\.(\w+)/;
> }
> close CLIENTCONF;
Ok, so here you have two arrays, one of which you initialised, and the
other which you didn't initialise, and which isn't used at all
anymore. -w would have warned.
Without knowing how the data in the file looks, I can't comment on
the way you extract information from it.
> $count1=@client_prod_list;
> for($b=0;$b<=$count1;$b++)
$count1 is the number of elements in client_prod_list. Not the
index of the last element. You either want $#client_prod_list, or
you want $b < $count1. Better would be to not use a $b or $count1.
foreach (@client_prod_list)
{
> {
> open(PRODUCTFILE, ">> /usr/cmis/cmisx/prodfile") || die "Can't
> open:$!\n";
Why do you open the file for appending for each element in the list?
You only really need to open and close the file once.
> $d="$client_prod_list[$b]";
Why the temporary variable?
> @ARGV="/users/operator/cislist";
You want this to be a list, right? not a string.
> while (<>)
Are you sure you want to do it this way, and not by opening files yourself?
> if(/^$d/)
Of course this works. Try the following:
#!/usr/local/bin/perl -w
use strict;
my $foobar = 'foobar';
foreach my $foo (qw(foo bar ooba blob))
{
($foobar =~ /$foo/) and print "$foo in $foobar\n";
($foobar =~ /^$foo/) and print "$foo at start of $foobar\n";
($foobar =~ /$foo$/) and print "$foo at end of $foobar\n";
}
__END__
foo in foobar
foo at start of foobar
bar in foobar
bar at end of foobar
ooba in foobar
If you fix all the other things in your script, and check if there's
actually anything in $client_prod_list[$b], and you use the -w flag,
and strict, you will most likely find that your script suddenly starts
working.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd. | enough features yet.
NSW, Australia |
------------------------------
Date: 29 Jan 1998 03:15:00 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: help needed with varaible in a pattern
Message-Id: <6aos7k$l70$2@comdyn.comdyn.com.au>
In article <34d29565.24052618@news.cmc.ec.gc.ca>,
sjuneau@microtec.net (Sylvain Juneau) writes:
> if(/^$d/)
addition to my other post. If $d contains any metacharacters, you'll
need to make sure you escape them. use quotemeta, or \Q\E modifiers.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au |
Commercial Dynamics Pty. Ltd. | What's another word for Thesaurus?
NSW, Australia |
------------------------------
Date: Wed, 28 Jan 1998 19:50:50 -0800
From: Thomas Waung <twaung@networkgen.com>
Subject: module variable scope
Message-Id: <34CFFC9A.986C5C13@networkgen.com>
Hi there.
I am trying to set global variable from within modules, is that
possible?
Here's some mock code...
-----
Test.pl
use Test_Mod;
$a = "a";
$b = "b";
Test_Mod::set_vars;
print "$a $b";
Test_Mod.pm
sub set_vars {
$a = "A";
$b = "B";
}
-----
when I run Test.pl, I get a output of "a b", and I was hoping for "A B".
I'm obviously missing something really obvious...could someone help me?
Thanks in advance,
-tom
------------------------------
Date: Thu, 29 Jan 1998 00:40:14 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: module variable scope
Message-Id: <comdog-ya02408000R2901980040140001@news.panix.com>
Keywords: from just another new york perl hacker
In article <34CFFC9A.986C5C13@networkgen.com>, Thomas Waung <twaung@networkgen.com> posted:
>I am trying to set global variable from within modules, is that
>possible?
global in what sense? do you mean that they are in the main::
namespace? it's certainly possible. perhaps you wanted to
export those variables?
for more info
perldoc perlmodlib
and see related documentation.
good luck :)
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
------------------------------
Date: 28 Jan 1998 22:48:57 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: multiple single line match
Message-Id: <6aou79$n4a@panix.com>
In <886003288.1218052101@dejanews.com> peter@uhu.com writes:
>I have a comma delimeted text database. Each value in the "field" is
>enclosed in '"' double quotes. There are a total of 31 "fields" in each
>line. Each line is a record. The datastructure is as follows: "Company
>Name","Platform","Status","Product","Platform","Status","Product","Platfo
>rm" ,...","Product"
Is the data "comma delimited" or "comma separated values" -- Surprising
difference between the two. :)
>1.) I have to "fish" out all products, and their respective platforms
>whose status is xyz. Each company can have more than one product with the
>same status. So far I got the REGEX for gettting out the Company name and
>the platform and product OK, but I don't know how to get the next one out
>of the same line, if there are multiple occurrences.
>So here is my code: (assuming string is in $_)
>open file;
>read in stuff;
>blah,blah,blah;
>&analyze_date;
Well, let's assume the "open file, read in, blah, blah" was ok...
>sub analyze_data { while(m/$somestatus/g) { /^\"([^\"]+?)\",/;
>$company = $1; /\"([^\"]+)\",\"$somestatus\",\"([^\"]+)\"/; $platform =
>$1; $product = $2; print "<tr>\n"; print " <td><font face=\"Arial\"
>size=\"1\"> $company <\/font><\/td>\n"; print " <td><font face=\"Arial\"
>size=\"1\"> $platform <\/font><\/td>\n"; print " <td><font
>face=\"Arial\" size=\"1\"> $product <\/font><\/td>\n"; print "<\/tr>\n";
> $num_recs++ } ## end while } ## end sub
Eeek! My eyes hurt.
sub analyze_data {
while (m/$somestatus/g) {
/^\"([^\"]+?)\",/;
$company = $1;
/\"([^\"]+)\",\"$somestatus\",\"([^\"]+)\"/;
$platform = $1;
$product = $2;
print "<tr>\n";
print " <td><font face=\"Arial\" size=\"1\"> $company <\/font><\/td>\n";
print " <td><font face=\"Arial\" size=\"1\"> $platform <\/font><\/td>\n";
print " <td><font face=\"Arial\" size=\"1\"> $product <\/font><\/td>\n";
print "<\/tr>\n";
$num_recs++ } ## end while } ## end sub
For some reason it seems extraordinarily cumbersome. If the data is comma-
delimited, split on a comman -- If it is CSV, take a look at Text::CSV.
>I tried to use \G, but did not find good examples of this assertion. My
>code retrieves only the very first occurrence and repeats the same(first)
>find as many times as many occurrences there are in the same line.
>QUESTION: How do I step to the next match ? How do I get all matches out
>of the same line?
open DB, "path-to/your/database/file/here" or die "Can't open database: $!\n";
while (<DB>) {
# split the data
# test it
# if you find one, process it
}
Let's say you have a match across multiple elements in the list from the
split -- Put the list contents into an array and grep the array for a
match. Something silly like:
#!/usr/local/bin/perl5.00403 -w
while (<DATA>) {
chomp;
my @test_array = split /\,/;
if (my @found = grep /orange/, @test_array) {
print @test_array, "\n";
}
}
__DATA__
apple, orange, lime, peach
nail, screw, bolt, orange
ink, paint, dye, tint
octopus, squid, clam, mussel
prints:
apple orange lime peach
nail screw bolt orange
--
Clay Irving <clay@panix.com> I think, therefore I am. I think?
http://www.panix.com/~clay/
------------------------------
Date: 29 Jan 1998 00:00:05 -0500
From: Mark Mielke <markm@nortel.ca>
Subject: Re: multiple single line match
Message-Id: <lq1lnvz98oa.fsf@bmers2e5.nortel.ca>
peter@uhu.com writes:
> I have a comma delimeted text database. Each value in the "field" is
> enclosed in '"' double quotes. There are a total of 31 "fields" in each
> line. Each line is a record. The datastructure is as follows: "Company
> Name","Platform","Status","Product","Platform","Status","Product","Platfo
> rm" ,...","Product"
Get something called Text::ParseWords from your local CPAN.
If i remember correctly you should be able to do something like:
$l = q{"Company Name","Platform","Status",...};
@l = parsewords(",", 0, $l);
And @l will be equal to ("Company Name", "Platform", "Status", "...").
It handles quoting correctly (if you get the latest version that is) and
you specify the separator as a regexp.
mark
P.S.
If you want my custom version of it that figures errors in the input
more accurately (i.e. "missing quote", "backslash at end of string") then
e-mail me for it.
-- _________________________
. . _ ._ . . .__ . . ._. .__ . . . .__ | Northern Telecom Ltd. |
|\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ | Box 3511, Station 'C' |
| | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, ON K1Y 4H7 |
markm@nortel.ca / al278@freenet.carleton.ca |_______________________|
------------------------------
Date: Wed, 28 Jan 1998 22:00:21 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: Odd syntax problem
Message-Id: <34CFF0C5.C763E6CB@coos.dartmouth.edu>
DJ Adams wrote:
>
> Chipmunk wrote in message <34CC260D.A07F712@coos.dartmouth.edu>...
>
> >"foo/bar/baz/" =~ m{(/.*?$)} will set $1 to "/bar/baz", *not* "/baz",
>
> Shouldn't $1 == "/bar/baz/" ?
Sorry, I meant to write:
"foo/bar/baz" =~ ...
Chipmunk
------------------------------
Date: 29 Jan 1998 03:29:26 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: PERL5x4x4 fails on 'make'
Message-Id: <6aot2m$l70$4@comdyn.comdyn.com.au>
[Subject: Re: PERL5x4x4 fails on 'make']
it's 5.004_04.
In article <34CFC0FB.BFB@esa.nascom.nasa.gov>,
G Dimitoglou <george@esa.nascom.nasa.gov> writes:
> ar rcu libperl.a perl.o gv.o toke.o perly.o op.o regcomp.o dump.o
> util.o mg.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o
> doop.o doio.o regexec.o taint.o deb.o universal.o globals.o perlio.o
> sh: ar: not found
^^ ^^ ^^^
Hmmm.. Looks like sh is complaining that it can't find ar. Did you
maybe miss that line? You just need to make sure that your path is
set up correctly.
HTH.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | For heaven's sake, don't TRY to be
Commercial Dynamics Pty. Ltd. | cynical. It's perfectly easy to be
NSW, Australia | cynical.
------------------------------
Date: Wed, 28 Jan 1998 22:26:46 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Problem with typeglob
Message-Id: <34D012BF.75A84FB6@5sigma.com>
Use a reference, not a typeglob.
-joseph
> How do I use a typeglob in this case without getting the Typographical
> error warning and without using `use vars (..)`?
>
> Thanks.
>
> gene
--
Joseph N. Hall, prop., 5 Sigma Productions mailto:joseph@5sigma.com
Author, Effective Perl Programming . . . . . http://www.effectiveperl.com
Perl Training . . . . . . . . . . . . . . . http://www.perltraining.com
------------------------------
Date: Thu, 29 Jan 1998 00:45:43 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: regexes: fun with /x
Message-Id: <34D01787.314F87EE@coos.dartmouth.edu>
Chipmunk wrote:
>
> Can you find a useful regex that will only work with the /x modifier?
I'd better clarify...
I don't mean something like /.#(/x. Without the /x modifier,
that would be /./, which also works.
What I have in mind is a regex that can be used with the /x modifier,
but will not work in its non-/x-modified form.
Chipmunk
------------------------------
Date: 29 Jan 1998 05:14:57 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: Regular expression help....
Message-Id: <qz$9801282354@qz.little-neck.ny.us>
Kevin Miles <kmiles@erols.com> wrote:
> Steel Viper wrote:
> > All I am trying to do is find the first 10 digit number that I
> > come to while reading a file, and then I want to replace it with
> Try this:
> $_ =~ s/\d{10}/WHATEVER/
Fine, but the '$_ =~' bit is unneeded there.
> or , if you might have numbers with more than 10 digits
>
> $_ =~ s/\D+\d{10}\D+/WHATEVER/
That one is broken for your problem spec. Watch:
#!/usr/bin/perl -w
$\ = "\n";
$_ = '0123456789: just 1234567890 new york perl hackers';
s/\D+\d{10}\D+/WHATEVER/;
print 'First method:';
print;
$_ = '0123456789: just 1234567890 new york perl hackers';
s/( # capturing parens
^ # start of line
| # or
\D # non-number
) #
\d # number
{10} # 10 of last pattern
(?! # not followed by
\d # a number
) #
/${1}WHATEVER/x; # replace it; /x -> extended format
print 'Second method:';
print;
__END__
:r! perl -x %
First method:
0123456789WHATEVER
Second method:
WHATEVER: just 1234567890 new york perl hackers
Elijah
------
perl -we '$_="anVzdCBhbm90aGVyIG5ldyB5b3JrIHBlcmwgaGFja2VyCg==";
s/.*/eval"use MIME::Base64",decode_base64($&)/e;print;'
------------------------------
Date: Wed, 28 Jan 1998 19:30:41 -0800
From: Bob Bowker <bowker@earthlink.net>
Subject: RPMs for 5.004-4
Message-Id: <34CFF7E1.A34860AD@earthlink.net>
Hi -
Can anyone direct me to a source for an rpm of version 5.004-4?
TIA -
Bob Bowker
bowker@earthlink.net
------------------------------
Date: 28 Jan 1998 21:59:13 -0500
From: Justin Vallon <vallon@pearl.fi.bear.com>
Subject: Re: Some Questions Regarding Error Messages Generated by the -w switch
Message-Id: <x6eiur4vvct.fsf@pearl.fi.bear.com>
"V. Chandrasekhar" <vchandra@mail.delcoelect.com> writes:
> $~ = Line1; write ; $~ = Line2; write ; $~ = Line3; write ; # 858
I would split these up so that you know which format is giving you problems.
> 4. -w gives the following errors
>
> Possible typo: "Line12" at truckconv.pl line 848.
> < Snipped >
> Possible typo: "Line1" at truckconv.pl line 674.
>
> (Lines 674 and 848 are the '.' signifying the end of the format
> specifications
> Line1 and Line12)
I haven't really used formats, so I am not sure what it is considering a
typo. It looks like it is giving you the message after the end of the
format.
> Use of uninitialized variable at truckconv.pl line 858, <TESTDATA> line
> 5.
[...]
> is called only after the loop. I do not understand the " <TESTDATA> line
> 5 "
> reference.
You probably did not close TESTDATA. What perl is trying to do is be
helpful in the following situation:
open FILE, "file";
while (<FILE>) {
chop;
die "Blank line" if $_ eq "";
}
# should close FILE
die "After loop";
perl would say: "Blank line at line 4, <FILE> line 23". Which would tell
you that you were on line 23 of FILE. If none of the lines are blank,
you'll get:
"After loop at line 7, <FILE> line n". If you close FILE, the
'<FILE> line n' messages will go away.
> V. Chandrasekhar
--
-Justin
vallon@bear.com
------------------------------
Date: 28 Jan 1998 23:51:20 -0500
From: Mark Mielke <markm@nortel.ca>
Subject: Re: Split
Message-Id: <lq1oh0v992v.fsf@bmers2e5.nortel.ca>
Moshe Aaron Allen <moshea@jen.co.il> writes:
> Hi, I'm need to split() a pararaph after every five words. Can anyone help?
How about something like:
my $wordcount = 0;
while (<>) {
while (/(\S+)/g) {
print " " if $wordcount;
print $1;
if (++$wordcount == 5) {
$wordcount = 0;
print "\n";
}
}
}
print "\n" if $wordcount;
This should work better than the other example.
Just pass your file as:
myscript paragraphfile >splitparagraphfile
good luck.
mark
-- _________________________
. . _ ._ . . .__ . . ._. .__ . . . .__ | Northern Telecom Ltd. |
|\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ | Box 3511, Station 'C' |
| | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, ON K1Y 4H7 |
markm@nortel.ca / al278@freenet.carleton.ca |_______________________|
------------------------------
Date: Thu, 29 Jan 1998 06:29:04 GMT
From: webmaster@builderpress.com (A.E. Halpin)
Subject: Text Problems With Explorer 4.0
Message-Id: <6ap4vo$lv$1@news.greatbasin.net>
Hi all,
I may be jumping in late on a previous discussion, but this problem
only recently came to light. I recently learned that a few folks
submitting to my cgi forms were having problems with their data being
posted, and the bug traces back to only those people using Explorer
4.0 or 4.01. I checked into this on my own and it seems that IE4 is
not passing values on type="text" fields on my cgi forms. I have
absolutely no clue why IE4 isn't passing along these field values, and
I can't find a way to make it work (not that I enjoy the idea of going
back through 3+ years of forms to make changes to accomodate an
apparent bug in IE4). Has anyone else encountered this? Your help may
help save my sanity.
Greg Campbell,
Washoe Media
------------------------------
Date: 28 Jan 1998 22:04:25 -0500
From: Justin Vallon <vallon@pearl.fi.bear.com>
Subject: Re: under what shell system(...) runs the unix command?
Message-Id: <x6eg1m8vv46.fsf@pearl.fi.bear.com>
mwang@alhena.ibk.ml.com (Michael Wang) writes:
> under what shell system(...) runs the unix command?
> ksh or sh or the shell that starts the perl? And where
> it is documented? Thanks.
man perlfunc:
system LIST
Does exactly the same thing as "exec LIST" except that a fork
is done first, and the parent process waits for the child
process to complete. ...
...
exec LIST
The exec() function executes a system command AND NEVER
RETURNS. Use the system() function if you want it to return.
If there is more than one argument in LIST, or if LIST is an
array with more than one value, calls execvp(3) with the
arguments in LIST. If there is only one scalar argument, the
argument is checked for shell metacharacters. If there are
any, the entire argument is passed to /bin/sh -c for parsing.
If there are none, the argument is split into words and passed
directly to execvp(), which is more efficient. ...
/bin/sh.
--
-Justin
vallon@bear.com
------------------------------
Date: 29 Jan 1998 04:15:40 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: UNIX to Win: Script *Still* Won't Go
Message-Id: <6aovpc$lg0$1@comdyn.comdyn.com.au>
In article <nmcnelly-2801982111410001@ppp-92-30.bu.edu>,
nmcnelly@bu.edu (N.A.F. McNelly) writes:
> Test1 error message - Can't call method "copy" without a package or reference
> at c:\perl\datef\test1.pl line 15
>
> Since this script uses GD.pm, could that be where the source of
> where the error lies? The text that gave the above error message is:
>
> #!/usr/local/bin/perl
> use GD;
> print "Enter The Desired Name of the Output File: ";
> $name=<STDIN>;
> $last=".gif";
> $nme=$name . $last;
> $file = 'C:/perl/datef/start.gif';
> open (GIF, $file) || die "$file: $!";
> $im = newFromGif GD::Image(GIF);
Maybe you should check to see if this constructor actually worked.
$im = newFromGif GD::Image(GIF) or die "Couldn't create GD object";
Just like the documentation suggests.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Very funny Scotty, now beam down my
Commercial Dynamics Pty. Ltd. | clothes.
NSW, Australia |
------------------------------
Date: 29 Jan 1998 05:02:33 GMT
From: pauljcase@aol.com (PaulJCase)
Subject: Re: unzip utility for alpha NT?
Message-Id: <19980129050201.AAA13992@ladder03.news.aol.com>
I'm having the same problem, have you found a solution yet? if so how did you
do it?
------------------------------
Date: 29 Jan 1998 05:28:27 GMT
From: pauljcase@aol.com (PaulJCase)
Subject: Why can't I unzip?
Message-Id: <19980129052800.AAA17614@ladder03.news.aol.com>
I just downloaded latest.tar and I can't for the life of me get it open? why?
Thank you
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 1756
**************************************