[19294] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1489 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 10 14:10:54 2001

Date: Fri, 10 Aug 2001 11:10:17 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <997467017-v10-i1489@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 10 Aug 2001     Volume: 10 Number: 1489

Today's topics:
        regex question... <strawSPAM_BEGONEman@plexi.com>
    Re: regex question... <ilya@martynov.org>
        Retrieving the Date <Pcmann1@btinternet.com>
    Re: Retrieving the Date <Tassilo.Parseval@post.rwth-aachen.de>
    Re: Retrieving the Date <Thomas@Baetzler.de>
    Re: Retrieving the Date <philippe.perrin@sxb.bsf.alcatel.fr>
    Re: Retrieving the Date <tony_curtis32@yahoo.com>
    Re: Self-Searchable Perl documention - Extremely Useful (John Holdsworth)
        Simulating ASP tricks in Perl (Mark Deibert)
    Re: Simulating ASP tricks in Perl <ilya@martynov.org>
    Re: Sub that defaults to use $_ in callers context <mjcarman@home.com>
    Re: Sub that defaults to use $_ in callers context (Anno Siegel)
    Re: telnet session through perl <Tassilo.Parseval@post.rwth-aachen.de>
        test (Geoff Harden)
    Re: test (Tad McClellan)
    Re: This is not a question ... call me slow if you like <paul@net366.com>
    Re: This is not a question ... call me slow if you like (Tad McClellan)
        Unable to retain required "+" from STDIN (agent349)
    Re: Update: (Perl) programming contest loosely based on (Yves Orton)
    Re: whitespace flatfile db <bart.lateur@skynet.be>
    Re: Why is $i so popular? (Yves Orton)
    Re: Why is $i so popular? <paul@net366.com>
    Re: Why? <bart.lateur@skynet.be>
    Re: Why? <paul@net366.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 10 Aug 2001 12:23:03 -0400
From: A person <strawSPAM_BEGONEman@plexi.com>
Subject: regex question...
Message-Id: <3B740A67.F599A8C7@plexi.com>


I'm trying to replace all instances on a line of [number] with
[number-1].


What I came up with was:

while(<FH>) {
    ...
    s#\[(\d*)\]#decr($1)#ge;

    print FH2;
}


sub decr {
    my $number = shift;
    $number--;

    return "[$number]";
}


which works fine.




My question is, Can I do this in the regex itself without writing the
function decr?


Thanks for any help.



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

Date: 10 Aug 2001 20:36:25 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: regex question...
Message-Id: <874rrfzxbq.fsf@abra.ru>


Ap> I'm trying to replace all instances on a line of [number] with
Ap> [number-1].


Ap> What I came up with was:

Ap> while(<FH>) {
Ap>     ...
Ap>     s#\[(\d*)\]#decr($1)#ge;

        s#\[(\d*)\]#'[' . ($1 - 1) . ']'#ge;

Ap>     print FH2;
Ap> }


Ap> sub decr {
Ap>     my $number = shift;
Ap>     $number--;

Ap>     return "[$number]";
Ap> }


Ap> which works fine.




Ap> My question is, Can I do this in the regex itself without writing the
Ap> function decr?


Ap> Thanks for any help.


-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)                                    |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/)                          |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


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

Date: Fri, 10 Aug 2001 16:06:30 +0100
From: "Peter Mann" <Pcmann1@btinternet.com>
Subject: Retrieving the Date
Message-Id: <9l0t7v$d3v$1@plutonium.btinternet.com>

Dear All,
    Could someone please advise me of the appropriate function/library to
acquire the date for the current day! Im new the Perl language and not yet
acquited with the core libraries available to use. The only way I currently
know of is via the TK::Date widget, but his is not what i want to use.

Thanks in advance,

Regards,
    - Pete




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

Date: Fri, 10 Aug 2001 17:17:48 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: Retrieving the Date
Message-Id: <3B73FB1C.8000906@post.rwth-aachen.de>

Peter Mann wrote:
> Dear All,
>     Could someone please advise me of the appropriate function/library to
> acquire the date for the current day! Im new the Perl language and not yet
> acquited with the core libraries available to use. The only way I currently
> know of is via the TK::Date widget, but his is not what i want to use.
> 
> Thanks in advance,

You are probably looking for something like localtime. See perldoc -f 
localtime for that.
Note that localtime behaves differently in scalar and list context.

@t = localtime; # will produce an array
$t = localtime; # human readable string


Tassilo
-- 
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};



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

Date: Fri, 10 Aug 2001 17:21:59 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: Retrieving the Date
Message-Id: <fsu7nt8ngi8ast15uddg4njaqr1e77ie8q@4ax.com>

On Fri, 10 Aug 2001, "Peter Mann" <Pcmann1@btinternet.com> wrote:
>    Could someone please advise me of the appropriate function/library to
>acquire the date for the current day! Im new the Perl language and not yet
>acquited with the core libraries available to use. The only way I currently
>know of is via the TK::Date widget, but his is not what i want to use.

# date today
my ( $day, $month, $year ) = ( localtime time ) [ 3..5 ];
$month++;
$year+= 1900;

You can also check out "perldoc perlfunc" and search for "Time-related
functions" to get you started.

HTH,
-- 
Thomas Baetzler - http://baetzler.de/ - Clan LoL - http://lavabackflips.de/
I am the "ILOVEGNU" signature virus. Just copy me to your signature.
This post was infected under the terms of the GNU General Public License.


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

Date: Fri, 10 Aug 2001 17:17:40 +0200
From: Philippe PERRIN <philippe.perrin@sxb.bsf.alcatel.fr>
Subject: Re: Retrieving the Date
Message-Id: <3B73FB14.3AC0FED3@sxb.bsf.alcatel.fr>

$date = scalar(localtime); # eg "Fri Aug 10 17:17:03 2001"


Peter Mann wrote:
> 
> Dear All,
>     Could someone please advise me of the appropriate function/library to
> acquire the date for the current day! Im new the Perl language and not yet
> acquited with the core libraries available to use. The only way I currently
> know of is via the TK::Date widget, but his is not what i want to use.
> 
> Thanks in advance,
> 
> Regards,
>     - Pete

-- 
PhP


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

Date: 10 Aug 2001 10:36:00 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Retrieving the Date
Message-Id: <8766bwsza7.fsf@limey.hpcc.uh.edu>

>> On Fri, 10 Aug 2001 17:17:40 +0200,
>> Philippe PERRIN <philippe.perrin@sxb.bsf.alcatel.fr> said:

> Peter Mann wrote:
>>  Dear All, Could someone please advise me of the
>> appropriate function/library to acquire the date for
>> the current day! Im new the Perl language and not yet
>> acquited with the core libraries available to use. The
>> only way I currently know of is via the TK::Date
>> widget, but his is not what i want to use.
>> 
>> Thanks in advance,
>> 
>> Regards, - Pete

> $date = scalar(localtime); # eg "Fri Aug 10 17:17:03 2001"

    $date = localtime;

would do since it's already a scalar context.

Note also strftime() in the POSIX module if you want to
do interesting date formatting.

-- 
Beep beep!  Out of my way, I'm a motorist!


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

Date: 10 Aug 2001 08:13:33 -0700
From: coldwave@bigfoot.com (John Holdsworth)
Subject: Re: Self-Searchable Perl documention - Extremely Useful!
Message-Id: <2a46b11e.0108100713.4f12cc@posting.google.com>

David Coppit <newspost@coppit.org> wrote in message news:<3B65AF04.2050906@coppit.org>...
> John Holdsworth wrote:
 ...
> > http://www.openpsp.org/source/perltoc.pl
>
> Hi John,
> 
> I tried it out, and it's really cool. Could you tell us a little bit 
> about how it works?
 ...
> The main reason I ask is that I'm interested in techniques for building 
> web-based interfaces to Perl programs, and most Windows folks don't have 
> web servers running on their machines.

David,

You got me thinking here and I've published a short example
perl application with a browser interface (a version of du).
This could be a .html file but a ".hta" removes the IE-ness.

http://www.openpsp.org/source/util/du.hta.gz

john


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

Date: 10 Aug 2001 10:13:41 -0700
From: area31@mail.com (Mark Deibert)
Subject: Simulating ASP tricks in Perl
Message-Id: <20f405bf.0108100913.129f4de8@posting.google.com>

Is it possible to simulate ASP session and application varibles using
Perl running stand alone? No ASP page. The only thing I can think of
is using a database record or text file on server disk. Is there more
elegant way?

Thanks a lot for your suggestions,

Mark Deibert


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

Date: 10 Aug 2001 22:05:38 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: Simulating ASP tricks in Perl
Message-Id: <87itfvx025.fsf@abra.ru>


MD> Is it possible to simulate ASP session and application varibles using
MD> Perl running stand alone? No ASP page. The only thing I can think of
MD> is using a database record or text file on server disk. Is there more
MD> elegant way?

Look at Apache::Session.

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)                                    |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/)                          |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


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

Date: Fri, 10 Aug 2001 10:35:29 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Sub that defaults to use $_ in callers context
Message-Id: <3B73FF41.822CD0D3@home.com>

Anno Siegel wrote:
> According to Michael Carman  <mjcarman@home.com>:
> > Yves Orton wrote:
> 
> [making $_ a default sub parameter]
> 
> > Of course, if you want to be able to pass in false values, you
> > should change that to:
> >
> > sub foo {
> >     my $param = (defined $_[0]) ? $_[0] : $_;
> >     #...
> > }
> 
> This still doesn't let you pass "undef" explicitly as in foo(undef).
> This is more general:
> 
>     my $param = @_ ? shift : $_;

Good point. That made me think that I what I should have said is:

    my $param = (exists $_[0]) ? shift : $_;

Which should work in Perl 5.6. (Anno's solution is more flexible and
will also work in older Perls.) 

It *doesn't* work though, even though @_ does in fact contain (undef).
Preceding that line with 

    @_ = (undef);

will of course destroy any args passed in, but makes exists($_[0])
return true.

Is this a bug in exists()? Or a side effect of Perl's argument passing
scheme? Is there an existance flag that's only set for manual
initializations, not implicit ones?

-mjc


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

Date: 10 Aug 2001 16:51:43 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Sub that defaults to use $_ in callers context
Message-Id: <9l13ev$56g$1@mamenchi.zrz.TU-Berlin.DE>

According to Michael Carman  <mjcarman@home.com>:
> Anno Siegel wrote:
> > According to Michael Carman  <mjcarman@home.com>:
> > > Yves Orton wrote:
> > 
> > [making $_ a default sub parameter]
> > 
> > > Of course, if you want to be able to pass in false values, you
> > > should change that to:
> > >
> > > sub foo {
> > >     my $param = (defined $_[0]) ? $_[0] : $_;
> > >     #...
> > > }
> > 
> > This still doesn't let you pass "undef" explicitly as in foo(undef).
> > This is more general:
> > 
> >     my $param = @_ ? shift : $_;
> 
> Good point. That made me think that I what I should have said is:
> 
>     my $param = (exists $_[0]) ? shift : $_;
> 
> Which should work in Perl 5.6. (Anno's solution is more flexible and
> will also work in older Perls.) 
> 
> It *doesn't* work though, even though @_ does in fact contain (undef).

Indeed.  "exists $_[0]" doesn't recognize an undef that is passed in.

> Preceding that line with 
> 
>     @_ = (undef);
> 
> will of course destroy any args passed in, but makes exists($_[0])
> return true.
> 
> Is this a bug in exists()? Or a side effect of Perl's argument passing
> scheme?

Both, I would think.  @_ resides on the stack and is accessed by
other means than a normal array (in addition to the normal means).  
Maybe its length is stored in an unusual place or something.

>          Is there an existance flag that's only set for manual
> initializations, not implicit ones?

I don't think so.  @_ is just more equal than other arrays.

The usefulness of "exists" for array elements has been debated.  Your's
seems a reasonable application, but I'm not convinced we need it.

Anno


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

Date: Fri, 10 Aug 2001 17:10:14 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: telnet session through perl
Message-Id: <3B73F956.2060107@post.rwth-aachen.de>

Scaramouche wrote:
> i'm attempting to create an html page that'll list a number of ip addresses.
> my goal is to allow (intranet) users to click on these hyperlinks, pass the
> specific ipaddress as the 'QUERY_STRING' value, to a script that'll in turn
> kick off a telnet session to that specific ipaddress.
> i've not been successful with a c++ script i wrote.  it doesn't error out,
> but ms telnet is not being executed for whatever the reason.  the
> 'QUERY_STRING' value however, is on the money.
> although i'm a perl newbie i'm thinking perl would be a good option for
> this.
> is perl a feasible choice for this type of action? would someone point me in
> the right direction ?
> below is an example of what i've tried w/out success:
> 
> $ip_address = $ENV{'QUERY_STRING'};
> print "$ip_address"; #debug purposes
> system("telnet $ip_address"); #nothing happens here. no error msgs no
> telnet.

Ummh, where do you expect would the telnet session show up? You have 
someone sitting in, say, Hawaii who clicks on the hyperlink. Now we 
assume you are in Alaska. That means, data are passed from Hawaii to 
Alaska via CGI.
This one direction.
But how do you expect will the response from Alaska (the telnet session) 
get back to Hawaii?

In short: This executes "telnet $ip_address" locally on your server. If 
you want it ti be executed on client-side you probably wont get far with 
CGI. For that, you'd probably need something like an applet which runs 
on client-side.


Tassilo

-- 
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};



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

Date: 10 Aug 2001 09:25:12 -0700
From: geoffh@oasisnetwork.com (Geoff Harden)
Subject: test
Message-Id: <caf5717f.0108100825.40c82cda@posting.google.com>

again just checking sorry about this.


Geoff


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

Date: Fri, 10 Aug 2001 16:56:20 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: test
Message-Id: <slrn9n81es.1bu.tadmc@tadmc26.august.net>

Geoff Harden <geoffh@oasisnetwork.com> wrote:

>again just checking sorry about this.


just plonking sorry about that.


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


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

Date: Fri, 10 Aug 2001 16:07:07 +0100
From: "Paul Fortescue" <paul@net366.com>
Subject: Re: This is not a question ... call me slow if you like...
Message-Id: <997455955.6181.0.nnrp-13.d4f094e4@news.demon.co.uk>


"Martien Verbruggen" <mgjv@tradingpost.com.au> wrote in message
news:slrn9n7pek.cq.mgjv@martien.heliotrope.home...
> On Fri, 10 Aug 2001 23:10:36 +1000,
> Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
> > On Fri, 10 Aug 2001 13:35:01 +0100,
> > Paul Fortescue <paul@net366.com> wrote:
> >> But I think I've just realised what those funny signatures are at the
bottom
> >> of these postings.
> >>
> > [snip  of 15 line JAPH]
> >
> > Seems you did. However, normally signatures are less than 4 lines long,
> > where lines are kept within 80 characters :) Maybe you can compress it
> >:)
>
> And just to prove that compression makes it shorter, run the following
> through
>
> perl -MCompress::Zlib -MMIME::Base64 -l
>
> for (unpack(("A67"x6).("A59"x8), uncompress(decode_base64(q(
>
eJw9k4uR4zAMQ1vin+y/sntQvOeZxIoEiiCAbB+PX2ReO8tebZxt6DtvuuLM3tY72dvaq7dWcU52
>
X81tzNm5/wDjntTNcc/kAA2P27SbKFB8ztPbbo3u62f9gGEqSPpbpf/IcMmMWIJZ8LP+vz9o3n3J
>
BOA71R96tQ4f8/6QRSm01/2SURy2FXv5DXUw4mf3QNBPh/RhLN+Bawe1AUDdONllxGkOdEVUZEBS
>
3CvXxE6qQD2onlo1hN+1oenmExp+S/m0RtNTMEMG0I3+Vh1tHctk4fDdirKZ4pf5mFnt5M6Yx7av
>
rQG0ifRib2ntFR0BR13i2QUJ7gh0TGDWNjBgOWof9amNGPCISuQaMZdCJfsZMOLT7JmvEjg8g3yQ
>
X6cQcUkkGZMIrIa6Nz6Ho1Ss3GBiXPjdFhK2UMUyvg09SUgWF4jZX+RI0W8ptT5kQpO4DLSVgc/T
>
Qiwg6/XlhIBoUjQlBehbSqwCM45DPaLosuXiGY7xhBi5ldZo+nZ1/gi7dHl/CVJRmG1XlKohlupt
> fxOo+v4BN9e1hg==))))) { y/0-79/_/; print }
>
> It's definitely much more obscured, but still too long, though :) And if
> I didn't have to post it, I probably wouldn't have to use the mime
> encoding, but it'd still be too long.
>
> Martien
> --
> Martien Verbruggen              |
> Interactive Media Division      |
> Commercial Dynamics Pty. Ltd.   | What's another word for Thesaurus?
> NSW, Australia                  |

I think that's pretty neat, but what is
perl -MCompress::Zlib -MMIME::Base64 -l

I am using ActivePerl and I don't speak UNIX.




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

Date: Fri, 10 Aug 2001 11:56:24 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: This is not a question ... call me slow if you like...
Message-Id: <slrn9n8118.18o.tadmc@tadmc26.august.net>

Paul Fortescue <paul@net366.com> wrote:

>> --
>> Martien Verbruggen              |
>> Interactive Media Division      |
>> Commercial Dynamics Pty. Ltd.   | What's another word for Thesaurus?
>> NSW, Australia                  |


Please do not quote .sigs.


>I think that's pretty neat, but what is
>perl -MCompress::Zlib -MMIME::Base64 -l
>
>I am using ActivePerl and I don't speak UNIX.


That's OK, because the above is Perl, not Unix.

Just look up -M and -l in Perl's standard documentation:

   perldoc perlrun


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


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

Date: 10 Aug 2001 10:45:50 -0700
From: agent349@yahoo.com (agent349)
Subject: Unable to retain required "+" from STDIN
Message-Id: <e23997a6.0108100945.2b3797bd@posting.google.com>

This is really bugging me... $values =~ s/\+/ /g; removes all "+"s
from STDIN to clean up the data, fine. But I need to retain certain
plus signs and pass them along. ie: If I submit "1+1=2" in my form,
the plus is removed and what gets passed is "11=2", that ain't cool.
Any ideas on how I can retain required plus signs and remove the rest?


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

Date: 10 Aug 2001 10:00:21 -0700
From: demerphq@hotmail.com (Yves Orton)
Subject: Re: Update: (Perl) programming contest loosely based on the prisoners' dilemma
Message-Id: <74f348f7.0108100900.6ce26720@posting.google.com>

"Steffen M?ler" <tsee@gmx.net> wrote in message news:<9l0m17$r0b$07$1@news.t-online.com>...
> "Yves Orton" <demerphq@hotmail.com> schrieb im Newsbeitrag
> news:74f348f7.0108100359.2b7908f4@posting.google.com...
> > This sounds like Core-Wars or Core-Bots.
> >
> > Yves
> > Im interested in hearing more though. Sounds neat.
> 
> Yeah, now that you mention Core Wars, it reminds me of it, too. Only
> concerning the playing grounds, however.
> 
> I cannot really tell you a lot more because there isn't yet. Before I start
> working on the platform for the contest (eg. the glue between the entries),
> I wanted to get some feedback if such a contest is wanted at all.
> Considering the incredible amount of follow-ups, I might not start at all...

Hmm, well this is the first Ive heard of it.  I suspect that if you
announced an ACTUAL contest instead of ideas about one then you would
get more feedback.

Anyway, I've had similar thoughts in the past so if you want to send
me an email direct I'd be interested in helping out...

Yves


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

Date: Fri, 10 Aug 2001 17:43:20 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: whitespace flatfile db
Message-Id: <u778nt4ivr2r0bu2v7qp20fvpfi3g9g04u@4ax.com>

Yew wrote:

>Sorry, but this is a newbie question. I've with me a flat file that stores
>the data along columns separated by spaces only (not tab limited) and would
>like to be able to run queries on it. Is it possible to find scripts that
>can read such files in the first place? Most either need explicit tabs or
>comma's in place to be able to read it properly.

It's a variation on the CSV theme. You'll have to specify "sepchar" as
being a space.

You want to do queries on it? Checl out AnyData, and DBD::AnyData
combined with DBI (former DBD::RAM). That allows you to use SQL to do
queries on your data.

	<http://search.cpan.org/search?mode=module&query=AnyData>

-- 
	Bart.


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

Date: 10 Aug 2001 08:27:33 -0700
From: demerphq@hotmail.com (Yves Orton)
Subject: Re: Why is $i so popular?
Message-Id: <74f348f7.0108100727.2abad7ad@posting.google.com>

"Paul Fortescue" <paul@net366.com> wrote in message news:<997429593.24383.0.nnrp-13.d4f094e4@news.demon.co.uk>...
> "Lou Moran" <lmoran@wtsg.com> wrote in message
> news:oep5ntcvi3fduk1dn895kdv3l60ks7gsjf@4ax.com...

> I don't however, know why foo and bar exist, I was already past it by then!

I've always suspected it came from university students staying up all
night to sort out fubar'd code.  But thats only a theory.  On the
other hand I remember reading something about the early TMRC hackers
at MIT going to a chinese restaurant after late night hacks so maybe
foo comes from that?

Why dont people talk about subs 'sna' and 'foo'?

:-)

Yves


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

Date: Fri, 10 Aug 2001 16:38:16 +0100
From: "Paul Fortescue" <paul@net366.com>
Subject: Re: Why is $i so popular?
Message-Id: <997457832.7132.0.nnrp-13.d4f094e4@news.demon.co.uk>


"Yves Orton" <demerphq@hotmail.com> wrote in message
news:74f348f7.0108100727.2abad7ad@posting.google.com...
> "Paul Fortescue" <paul@net366.com> wrote in message
news:<997429593.24383.0.nnrp-13.d4f094e4@news.demon.co.uk>...
> > "Lou Moran" <lmoran@wtsg.com> wrote in message
> > news:oep5ntcvi3fduk1dn895kdv3l60ks7gsjf@4ax.com...
>
> > I don't however, know why foo and bar exist, I was already past it by
then!
>
> I've always suspected it came from university students staying up all
> night to sort out fubar'd code.  But thats only a theory.  On the
> other hand I remember reading something about the early TMRC hackers
> at MIT going to a chinese restaurant after late night hacks so maybe
> foo comes from that?
>
> Why dont people talk about subs 'sna' and 'foo'?
>
> :-)
>
> Yves

So

foreach $kung ($hai) {
    $fa="choi";
}

would be appropriate. Does it comes with rice? thinking about it, Perl looks
to me like a Chinese menu, written in Chinese!

I'll stop now, before I get flambeed





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

Date: Fri, 10 Aug 2001 15:23:09 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Why?
Message-Id: <91v7ntk05komvvri54790q8vh0kfn6g90n@4ax.com>

Paul Fortescue wrote:

>I have ordered several books including Mastering Regular
>Expressions so I will do some geeky reading this weekend!

for typeglobs, do check out "Advanced Perl Programming", also from
O'Reilly.

>but as you say, when it starts off with backticks (I don't even
>know what that means, nor bareword, nor several other terms) I panic and
>look for something else.

check out system() in perlfunc, and qx in perlop. Backticks are those
"`" characters, which serve to call external programs.

-- 
	Bart.


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

Date: Fri, 10 Aug 2001 16:34:04 +0100
From: "Paul Fortescue" <paul@net366.com>
Subject: Re: Why?
Message-Id: <997457569.6990.0.nnrp-13.d4f094e4@news.demon.co.uk>


"Bart Lateur" <bart.lateur@skynet.be> wrote in message
news:91v7ntk05komvvri54790q8vh0kfn6g90n@4ax.com...
> Paul Fortescue wrote:
>
> >I have ordered several books including Mastering Regular
> >Expressions so I will do some geeky reading this weekend!
>
> for typeglobs, do check out "Advanced Perl Programming", also from
> O'Reilly.
>
> >but as you say, when it starts off with backticks (I don't even
> >know what that means, nor bareword, nor several other terms) I panic and
> >look for something else.
>
> check out system() in perlfunc, and qx in perlop. Backticks are those
> "`" characters, which serve to call external programs.
>
> --
> Bart.
So it wasn't a technical thing; why do Americans assume that they speak the
same language as us Brits :) just 'cos they've got all the best programming
languages!?





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

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 1489
***************************************


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