[22003] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4225 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 6 09:05:38 2002

Date: Fri, 6 Dec 2002 06:05:10 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 6 Dec 2002     Volume: 10 Number: 4225

Today's topics:
        "Resume" control flow? edgue@web.de
    Re: "Resume" control flow? (Anno Siegel)
    Re: Array problem. <spikey-wan@bigfoot.com>
    Re: Array problem. <bart.lateur@pandora.be>
    Re: Benchmark testing (Tad McClellan)
    Re: Building Packages - Override Package Functions - In (Jay Tilton)
    Re: creating new linux user passwd using perl (Mitchell Laks)
        first element of a hash <nospam_stigerikson@yahoo.se>
    Re: first element of a hash (Helgi Briem)
    Re: first element of a hash <koos_pol@NO.nl.JUNK.compuware.MAIL.com>
    Re: first element of a hash <nospam_stigerikson@yahoo.se>
    Re: Get Bloomberg data with Perl? <mgjv@tradingpost.com.au>
    Re: Getting a URL Page <me@privacy.net>
    Re: Getting a URL Page <mgjv@tradingpost.com.au>
        Is there a kind of sleep or wait function? <a@b.c>
    Re: License cost for commercial use? <me@privacy.net>
    Re: mysql (Ben Morrow)
    Re: read from a process <sunil_franklin@hotmail.com>
        read from standard-input within one command? <a@b.c>
    Re: read from standard-input within one command? <bernard.el-hagin@DODGE_THISlido-tech.net>
    Re: read from standard-input within one command? <koos_pol@NO.nl.JUNK.compuware.MAIL.com>
    Re: read from standard-input within one command? (Helgi Briem)
    Re: read from standard-input within one command? (Tad McClellan)
    Re: read from standard-input within one command? <bernard.el-hagin@DODGE_THISlido-tech.net>
    Re: strange glob error (Ben Morrow)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Fri, 06 Dec 2002 12:53:57 +0100
From: edgue@web.de
Subject: "Resume" control flow?
Message-Id: <3DF08FD5.1010504@web.de>

Hi there,

I have code like this:

   do "$target";
   unless ($@)
   {
     # no perl message - no problem
     print("$target execution: OK\n");
   } # unless $@
   else
   {
     # do "$s_target" failed ...
     handle_error("$target execution: FAIL with $@");
   } # else - unless $@

The else branch is entered when something goes wrong
during "do $target", like a call to a method that
isnt defined.

Image $target points to a script:

 ...
   $obj->foox();
   $obj->bar();  # (*)

and foox() isnt there (because its a typo and should be foo()).
So perl will complain that it cant find foox().

Question:
Is it possible to "resume" perl to continue the "do" operation
to run obj->bar()?



------------------------------

Date: 6 Dec 2002 12:17:48 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: "Resume" control flow?
Message-Id: <asq4hc$d1c$1@mamenchi.zrz.TU-Berlin.DE>

According to  <edgue@web.de>:
> Hi there,
> 
> I have code like this:
> 
>    do "$target";
>    unless ($@)
>    {
>      # no perl message - no problem
>      print("$target execution: OK\n");
>    } # unless $@
>    else
>    {
>      # do "$s_target" failed ...
>      handle_error("$target execution: FAIL with $@");
>    } # else - unless $@
> 
> The else branch is entered when something goes wrong
> during "do $target", like a call to a method that
> isnt defined.
> 
> Image $target points to a script:
> 
> ...
>    $obj->foox();
>    $obj->bar();  # (*)
> 
> and foox() isnt there (because its a typo and should be foo()).
> So perl will complain that it cant find foox().

Well, that seems to be the purpose of checking $@ after do().  BTW,
"do FILE" is a really dated method of executing external Perl code.
Switch to require(), or make a module out of $target and "use" it.

> Question:
> Is it possible to "resume" perl to continue the "do" operation
> to run obj->bar()?

Not easily, and what would it gain you?  The "do" operation has invoked
another Perl interpreter, which crashed.  There really isn't any
consistent state to resume from after a crash.

Anno



------------------------------

Date: Fri, 6 Dec 2002 13:15:05 -0000
From: "Richard S Beckett" <spikey-wan@bigfoot.com>
Subject: Re: Array problem.
Message-Id: <asq7u5$dm4$1@newshost.mot.com>

"Bart Lateur" <bart.lateur@pandora.be> wrote in message
news:1tv0vu41ioomr1ldfr470ehmkpnaop1q5d@4ax.com...

> >my @buttons = "\$button1, \$button2, \$button3, etc...";
>
> A string!?!?! At least, you should have tried
>
> my @buttons = (\$button1, \$button2, \$button3);

Sorry, I made a mistake in my original question.
I tried:
my @buttons = ($button1, $button2...);
my @buttons = (\$button1, \$button2...);
my @buttons = ("\$button1", "\$button2"...);

Then I ran out of ideas, typed the post, and put:
my @buttons = "\$button1, \$button2, \$button3, etc...";

Which I hadn't tried. (But doesn't work, either ;-))

> >But it doesn't work.
> >How should I do this properly?
>
> To make a long story short: loop through the scalars containing the
> blessed references. Despite your subject line, you don't need an array,
> you can just do:
>
> sub disable_buttons {
>    foreach my $button ($button1, $button2, $button3) {
>        $button -> configure (-state => 'disable');
>   }
> }

GREAT! Thanks Bart, finally a simple, short solution that works! :-)

One further question, though...

If there are an awful lot of buttons, and many routines doing different
things to them, it would be nice to be able to replace this line:
foreach my $button ($button1, $button2, $button3, etc, etc, etc, etc, etc,
etc........................) {
with something like:
foreach my $button (@buttons) {
so that you can have one line of code that contains a list of all your
buttons. That way, if you add, or remove any buttons, you only have to
change the one line.

Is it possible to do this? (Obviously not with an array, as I've already
discovered)

Thanks.

R.






















------------------------------

Date: Fri, 06 Dec 2002 13:59:59 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Array problem.
Message-Id: <kta1vu81gsj3u9jehb59939b7bt2ksj92b@4ax.com>

Richard S Beckett wrote:

>If there are an awful lot of buttons, and many routines doing different
>things to them, it would be nice to be able to replace this line:
>foreach my $button ($button1, $button2, $button3, etc, etc, etc, etc, etc,
>etc........................) {
>with something like:
>foreach my $button (@buttons) {
>so that you can have one line of code that contains a list of all your
>buttons. That way, if you add, or remove any buttons, you only have to
>change the one line.
>
>Is it possible to do this? (Obviously not with an array, as I've already
>discovered)

But you can. It may not have been obvious from the above, but your
problem was not with the array, but with the fact that you took a
reference to each button, and nowhere do you dereference it again. And
unlike some other languages, Perl doesn't automatically dereference for
you. It's like C in this regard: you have to do the footwork yourself.

These should all work equally well:

	foreach my $button ($button1, $button2, $button3) {
	     $button->configure( -state => 'disable' );
	}

	@buttons = ($button1, $button2, $button3);
	foreach my $button (@buttons) {
	     $button->configure( -state => 'disable' );
	}

	@buttons = (\$button1, \$button2, \$button3);
	foreach my $button (@buttons) {
	     $$button->configure( -state => 'disable' );
	}

-- 
	Bart.


------------------------------

Date: Fri, 6 Dec 2002 07:37:48 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Benchmark testing
Message-Id: <slrnav1a1c.2n8.tadmc@magna.augustmail.com>

doofus <jim.bloggs@eudoramail.com> wrote:

> What's a good way of stepping through a program to find out what's
> taking it so long.

   perldoc -q profile


> Sorry if this is a really obvious question, but I didn't notice it in
> any of the FAQ's. Maybe I'm just blind, or stupid or something.. :(


"benchmark" was probably the wrong search term.

You use benchmarking to compare code and determine which 
of them is faster.

You first need to find out what is slow (profiling). Once you 
do that, you can use benchmarking to see if you can find an 
alternative that is faster.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Fri, 06 Dec 2002 11:30:46 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Building Packages - Override Package Functions - Including Inheritance
Message-Id: <3df088a1.127725257@news.erols.com>

"Rod" <palladium@spinn.net> wrote:

: I would like to write the packages where I have:
: Application_1_1.pm
: package Application_1_1;
: {snip}
: @EXPORT= qw(runme runyou runthem);
: 
: Application_1_2.pm
: package Application_1_2;
: use Application_1_1;
: {snip}
: @EXPORT= qw(runme runyou runthem);
: 
: But in Application_1_2.pm I just want to override the runme function and
: pass through any unchanged functions.
: 
: I hope this makes sense and any thought or suggestions would be appreciated.

What happened when you tried it just like you wrote it?

Odd use of the word "inheritance" in the subject line, though.
That's normally used in an object-oriented context, and exporting symbols
is something to avoid in an OO class/package.



------------------------------

Date: 6 Dec 2002 05:31:37 -0800
From: mlaks2000@yahoo.com (Mitchell Laks)
Subject: Re: creating new linux user passwd using perl
Message-Id: <ab3b13db.0212060531.7a2a9ac6@posting.google.com>

In case this is important. I am using RedHat linux 7.3 - i read
somewhere that solaris and sun os don't let you use pipes to change
passwds, while the man page on redhat seems to say that their version
does and the --stdin switch works to accept from a pipe.
since i see from the output that the passwd was successfully changed,
the question seems to be - TO WHAT? to debug this script, i wish i
could check what the passwd  was changed to, but i don't know how to
decrypt the /etc/shadow result. any ideas oh wizards?
mitchell

mlaks2000@yahoo.com (Mitchell Laks) wrote in message news:<ab3b13db.0212052224.2885a184@posting.google.com>...
> Hi i am trying to use perl script to create a new user passwd. the
> following script almost works
> 
> #!/usr/bin/perl
> my $password="bar";
> print "we now change password for foo \n ";
> open(PASS, "|passwd --stdin foo");
> print PASS "$password \n";
> print PASS "$password \n";
> close(PASS);
> 
> output from running it:
> 
> ./try.pl
> we nowchange password for foo
>  Changing password for user foo.
> passwd: all authentication tokens updated successful
> 
> so it seems to work... but when you try login to the account
> 
> the password "bar" doesnt work. 
> 
> why?
> 
> i also tried using 
> 
> print PASS "$password "; insead of 
> print PASS "$password \n"; but it doesnt help
> 
> thanks wizards!


------------------------------

Date: Fri, 06 Dec 2002 12:42:45 +0100
From: stig <nospam_stigerikson@yahoo.se>
Subject: first element of a hash
Message-Id: <asq2h0$b9j$1@oden.abc.se>

hi
newbee question.

i have a sorted hash
how can i get the first element out of the hash not knowing the key?
something like $array[0] to get the first element out of the array $array, 
only on a hash.

thanks
stig



------------------------------

Date: Fri, 06 Dec 2002 11:59:31 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: first element of a hash
Message-Id: <3df09111.143388392@news.cis.dfn.de>

On Fri, 06 Dec 2002 12:42:45 +0100, stig
<nospam_stigerikson@yahoo.se> wrote:

>i have a sorted hash
>how can i get the first element out of the hash not knowing the key?
>something like $array[0] to get the first element out of the array $array, 
>only on a hash.

my $first = $hash{(sort(keys %hash))[0]};
-- 
Regards, Helgi Briem
helgi AT decode DOT is

                           A: Top posting
                           Q: What is the most irritating thing on Usenet?
                                           - "Gordon" on apihna


------------------------------

Date: Fri, 06 Dec 2002 13:15:14 +0100
From: Koos Pol <koos_pol@NO.nl.JUNK.compuware.MAIL.com>
Subject: Re: first element of a hash
Message-Id: <newscache$e16p6h$pbf$1@news.emea.compuware.com>

stig wrote (Friday 06 December 2002 12:42):

> hi
> newbee question.
> 
> i have a sorted hash
> how can i get the first element out of the hash not knowing the key?


This is not possible and a contradiction in terminis. Hashes are not ordered 
lists. So there is no first, last, previous or next element.
What exactly does your data structure look like? And what is it you want to 
achieve?


> something like $array[0] to get the first element out of the array $array,
> only on a hash.
> 
> thanks
> stig

-- 
KP



------------------------------

Date: Fri, 06 Dec 2002 13:23:59 +0100
From: stig <nospam_stigerikson@yahoo.se>
Subject: Re: first element of a hash
Message-Id: <asq4u8$bri$1@oden.abc.se>

Helgi Briem wrote:

> On Fri, 06 Dec 2002 12:42:45 +0100, stig
> <nospam_stigerikson@yahoo.se> wrote:
> 
>>i have a sorted hash
>>how can i get the first element out of the hash not knowing the key?
>>something like $array[0] to get the first element out of the array $array,
>>only on a hash.
> 
> my $first = $hash{(sort(keys %hash))[0]};


thank you!

seems to work, changed the sorting however.
my $first = $hash{(sort { $a <=> $b } (keys %hash))[0]}


stig


------------------------------

Date: Fri, 6 Dec 2002 23:03:00 +1100
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: Get Bloomberg data with Perl?
Message-Id: <slrnav14fk.aid.mgjv@martien.heliotrope.home>

On Thu, 05 Dec 2002 21:35:55 +0000,
	Tzvi Oppenhimer <member@dbforums.com> wrote:
> 
> Originally posted by Michael Robbins 
>> Has anyone been able to get Bloomberg data into Perl?
>>
>> Bloomberg has an API, but only has examples for Java, VB, VBA, etc.
>> 
> Hi;
> 
> Have you succeed in getting Bloomberg data into Perl?

http://dbforums.com/showthread.php?threadid=491378

Next time you should try a search on Google yourself. It's often much
quicker than posting to Usenet.

Martien
-- 
                        | 
Martien Verbruggen      | System Administration is a dirty job, but
                        | someone said I had to do it.
                        | 


------------------------------

Date: Fri, 6 Dec 2002 22:52:59 +1100
From: "Tintin" <me@privacy.net>
Subject: Re: Getting a URL Page
Message-Id: <asq32q$tlaio$1@ID-172104.news.dfncis.de>


"Chris Boston" <cboston@e-duct-tape.com> wrote in message
news:TsZH9.28008$nd5.12683@news.bellsouth.net...
[top posts AGAIN]
>
> "Uri Guttman" <uri@stemsystems.com> wrote in message
> news:x7bs40q7tw.fsf@mail.sysarch.com...
> > >>>>> "CB" == Chris Boston <cboston@e-duct-tape.com> writes:
> >
> > don't top post.
> >
> > and don't triple post.
> >
> >   CB> Here is an example to get just a certain page off of a webserver
> >   CB> and write it to an output file that you can do something with
> >   CB> later, or you can pipe the oupt of wget to another process and
> >   CB> dont have to write the file.
> >
> >   CB> $get = "/usr/local/bin/wget --output-document=google.index.html";
> >   CB> $link = "http://www.google.com/index.html";
> >   CB> system("$get $link");
> >
> >   CB> once you install wget just issue wget --help and it will give you
> more
> >   CB> options than you will probably ever use.
> >
> > and running a process from perl when it is not needed is good in what
> > way?
> >
> > and that is better than LWP how?
> >
> > and how well does that handle & in the url?
> >
> > and why would you pipe the output to another process when you can read
> > it in perl directly?
> >
> > and why did you basically write a shell script in perl?
> >
> > if you can answer those questions, then you might be able to answer
> > others in this newsgroup.
>
> I agree with the dont triple post. That was an accident. Had some network
> problems.
>
> And as to why I wrote what I did. It is just an example. As you well know
> there are about a million ways to do everything in perl. This is just one
> that was quick and dirty that I know will work.

Are you trying to encourage Perl beginners to use quick & dirty code and
learn bad habits?
Where is the value in that?

I notice you didn't answer any of Uri's questions.

Just in case you really thought you were writing a Perl script, here is the
shell script equivalent.

#!/bin/sh
get = "/usr/local/bin/wget --output-document=google.index.html"
link = "http://www.google.com/index.html"
$get $link

You may notice some vague similarities to your "Perl" script.




------------------------------

Date: Fri, 6 Dec 2002 22:57:13 +1100
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: Getting a URL Page
Message-Id: <slrnav144p.aid.mgjv@martien.heliotrope.home>

On Fri, 6 Dec 2002 04:01:30 -0500,
	Chris Boston <cboston@e-duct-tape.com> wrote:

>>
>> don't top post.
>>
>> and don't triple post.
>>

> I agree with the dont triple post. That was an accident. Had some network
> problems.

And again, do not top-post, and trim the content of quoted text to the
necessary. I'll fix the order below.

> "Uri Guttman" <uri@stemsystems.com> wrote in message
> news:x7bs40q7tw.fsf@mail.sysarch.com...
>> >>>>> "CB" == Chris Boston <cboston@e-duct-tape.com> writes:

>>   CB> $get = "/usr/local/bin/wget --output-document=google.index.html";
>>   CB> $link = "http://www.google.com/index.html";
>>   CB> system("$get $link");
>>
>>   CB> once you install wget just issue wget --help and it will give you more
>>   CB> options than you will probably ever use.
>>
>> and running a process from perl when it is not needed is good in what
>> way?
>>
>> and that is better than LWP how?
>>
>> and how well does that handle & in the url?
>>
>> and why would you pipe the output to another process when you can read
>> it in perl directly?
>>
>> and why did you basically write a shell script in perl?
>>
>> if you can answer those questions, then you might be able to answer
>> others in this newsgroup.

> And as to why I wrote what I did. It is just an example. As you well know
> there are about a million ways to do everything in perl. This is just one
> that was quick and dirty that I know will work.

If he installs wget, then he doesn't need Perl. besides that, your
solution does _not_ work for many URLs, as Uri already told you.

There are many ways to do this in Perl, but yours is not a way to do it
in Perl. If you want to advise people to use wget, just do so. If you
wrap it in Perl code, and do so in a way that will break for many common
things, then you should expect criticism. If you call external programs
when there are perfectly capable solutions in Perl, expect criticism on
a Perl newsgroup.

Martien
-- 
                        | 
Martien Verbruggen      | 
                        | "Mr Kaplan. Paging Mr Kaplan..."
                        | 


------------------------------

Date: Fri, 06 Dec 2002 14:57:07 +0100
From: ZZT <a@b.c>
Subject: Is there a kind of sleep or wait function?
Message-Id: <asqabk$8kd$1@news1.wdf.sap-ag.de>

Hello,

I would like to wait a while inside a script. Is this possible?
If yes - how?

thanks



------------------------------

Date: Fri, 6 Dec 2002 22:55:36 +1100
From: "Tintin" <me@privacy.net>
Subject: Re: License cost for commercial use?
Message-Id: <asq37n$tuuev$1@ID-172104.news.dfncis.de>


"Martijn J.M.W. Bosgraaf" <m.bosgraaf@biotopen.nl> wrote in message
news:aspv5a$i30$1@reader11.wxs.nl...
> Hello,
>
> Are there any costs for using Perl when making an application for
commercial
> distribution?

Zit!  Nil!  Zero!  Zilch!  Nothing!  Gratis! etc, etc, etc.......




------------------------------

Date: Fri, 6 Dec 2002 12:48:15 +0000 (UTC)
From: mauzo@ux-ma160-14.csv.warwick.ac.uk (Ben Morrow)
Subject: Re: mysql
Message-Id: <asq6af$jh4$1@wisteria.csv.warwick.ac.uk>

Bart Lateur <bart.lateur@pandora.be> wrote:
>BTW you best connect to MSSQL Server with DBD::ODBC, at least from
>Windows. Why anyone would want to connect to MSSQL Server from any
>platform is an open question to me... :-) Well, I gather you can still
>use DBD::Sybase, though it's beyond my expertise.

You can indeed use DBD::Sybase to connect to MSSQL from other platforms: I have
done it from Linux. I needed to install freetds, though (google for it), as I
couldn't get the official sybase libs to work. YMMV, of course, and probably
will given this is M$ we're talking about.

Ben


------------------------------

Date: Fri, 6 Dec 2002 17:15:11 +0530
From: "Sunil" <sunil_franklin@hotmail.com>
Subject: Re: read from a process
Message-Id: <Z70I9.5$C53.112@news.oracle.com>


"Robert Szczygiel" <RobTM@fake.addr.ess> wrote in message
news:slrn.pl.av0qea.174.RobTM@pcmic25.cern.ch...
> ... and do not forget to kill the child when the error limit is
> exceeded.
>
> RobTM:)


I found the following post
http://www.perlmonks.org/index.pl?node_id=150904
    will redirecting errors and output to a file solve the "filling up the
pipe" issue?


Thanks,
Sunil.





------------------------------

Date: Fri, 06 Dec 2002 14:14:33 +0100
From: ZZT <a@b.c>
Subject: read from standard-input within one command?
Message-Id: <asq7rp$6je$1@news1.wdf.sap-ag.de>

Hello,

is there a way to read a value from standard-input (keyboard) with one 
command (without "open")?

thanks



------------------------------

Date: Fri, 6 Dec 2002 13:26:03 +0000 (UTC)
From: Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: read from standard-input within one command?
Message-Id: <asq8hb$586$6@korweta.task.gda.pl>

In article <asq7rp$6je$1@news1.wdf.sap-ag.de>, ZZT wrote:
> Hello,
> 
> is there a way to read a value from standard-input (keyboard) with one 
> command (without "open")?


my $why_dont_people_read_the_docs = <STDIN>;


Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'


------------------------------

Date: Fri, 06 Dec 2002 14:32:50 +0100
From: Koos Pol <koos_pol@NO.nl.JUNK.compuware.MAIL.com>
Subject: Re: read from standard-input within one command?
Message-Id: <newscache$qm9p6h$3ef$1@news.emea.compuware.com>

ZZT wrote (Friday 06 December 2002 14:14):

> Hello,
> 
> is there a way to read a value from standard-input (keyboard) with one
> command (without "open")?
> 
> thanks


What happened when you last searched the documentation for it?


-- 
KP



------------------------------

Date: Fri, 06 Dec 2002 13:33:09 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: read from standard-input within one command?
Message-Id: <3df0a60e.148761958@news.cis.dfn.de>

On Fri, 06 Dec 2002 14:14:33 +0100, ZZT <a@b.c> wrote:

>is there a way to read a value from standard-input (keyboard) 

my $value = <STDIN>;

>with one command (without "open")?

Why on earth would anyone use "open" to read
from the keyboard ?!?

Read 'perldoc -q keyboard' and 'perldoc -f open'


-- 
Regards, Helgi Briem
helgi AT decode DOT is

                           A: Top posting
                           Q: What is the most irritating thing on Usenet?
                                           - "Gordon" on apihna


------------------------------

Date: Fri, 6 Dec 2002 07:50:13 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: read from standard-input within one command?
Message-Id: <slrnav1aol.356.tadmc@magna.augustmail.com>

Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net> wrote:


> my $why_dont_people_read_the_docs = <STDIN>;


   "Just what we need, another Newsgroup Nazi." [1]




[1] Message-ID: <sg3d8u80fi1hg13r9iekv780jrrssigo4l@4ax.com>

-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Fri, 6 Dec 2002 13:54:14 +0000 (UTC)
From: Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: read from standard-input within one command?
Message-Id: <asqa66$586$8@korweta.task.gda.pl>

In article <slrnav1aol.356.tadmc@magna.augustmail.com>, Tad McClellan
wrote:
> Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net> wrote:
> 
> 
>> my $why_dont_people_read_the_docs = <STDIN>;
> 
> 
>    "Just what we need, another Newsgroup Nazi." [1]


I wonder what I'd look like in a Gestapo uniform.


Actually, my wife might go for that.


Mental note: stop by costume rental on way home.


Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'


------------------------------

Date: Fri, 6 Dec 2002 12:29:55 +0000 (UTC)
From: mauzo@ux-ma160-14.csv.warwick.ac.uk (Ben Morrow)
Subject: Re: strange glob error
Message-Id: <asq583$isa$1@wisteria.csv.warwick.ac.uk>

[Please don't top-post. It irritates people.]

sstark@us.ibm.com (Scott Stark) wrote:
>mauzo@mimosa.csv.warwick.ac.uk (Ben Morrow) wrote in message news:<asjeva$9ae$1@wisteria.csv.warwick.ac.uk>...
>> A pattern such as '*.c 'which expands to 'all files ending in .c in the current
>> directory' is called a glob. ...
>
>Thanks for the explanation. One other question, how can I capture the
>glob error so I can at least keep track of it? The script just
>continues to run as if nothing happened. (Unfortunately I'm unable to
>upgrade to perl 5.6.) Here's the output:
>
> checking firstdir....                                         
> checking seconddir....                                         
> glob failed (child exited with status 1) at ./fh.pl line 38, <_GEN_0>
>chunk 725.
> checking thirddir....

I would suggest installing File::Glob from CPAN, if you can. If your csh(1) is
broken, this will cause you problems with globbing :)

Failing that, see if you can fix your csh(1). If you have tcsh(1) installed, 
symlink it to /usr/bin/csh or summat so perl uses that.

Failing that, if csh fails I guess it will set $?. I don't know, cos I don't
have a machine with an old perl and a broken csh, but I would have thought it
should... Anyone?

Ben


------------------------------

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.  

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 V10 Issue 4225
***************************************


home help back first fref pref prev next nref lref last post