[18080] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 240 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 8 03:05:37 2001

Date: Thu, 8 Feb 2001 00:05:11 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <981619510-v10-i240@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 8 Feb 2001     Volume: 10 Number: 240

Today's topics:
    Re: about dying <peb@bms.umist.ac.uk>
    Re: Another XML::Parser Question <uri@sysarch.com>
        CGI.pm image upload probs todd@designsouth.net
        Devel DProf and " dprofpp " <godzilla@stomp.stomp.tokyo>
    Re: Devel DProf and " dprofpp " <uri@sysarch.com>
    Re: FAQ 3.28:   Where can I learn about object-oriented (Philip 'Yes, that's my address' Newton)
        flock unavailable on many platforms <johnlin@chttl.com.tw>
    Re: hex to binary conversion ? Please help <uri@sysarch.com>
    Re: how to remove item in the array? <peb@bms.umist.ac.uk>
    Re: Need Help Checking IP Address Syntax w/ PERL? <nospam.newton@gmx.li>
    Re: Need Help Checking IP Address Syntax w/ PERL? <nospam.newton@gmx.li>
    Re: Newbie - Perl for Win32 (Gasp!) <bwalton@rochester.rr.com>
    Re: Newbie here please help!  Permission errors while c <peter.sundstrom-eds@eds.com>
    Re: Package Positioning <bwalton@rochester.rr.com>
    Re: Perl DBI newbie question ... <bwalton@rochester.rr.com>
    Re: Poetry in Perl ??? <wuerz@yahoo.com>
    Re: Poetry in Perl ??? <godzilla@stomp.stomp.tokyo>
    Re: Poetry in Perl ??? egwong@netcom.com
    Re: Poetry in Perl ??? (Chris Fedde)
    Re: Radical readdir suggestion (Chris Fedde)
    Re: Setting Cookie Expiration Date with Perl (Richard J. Rauenzahn)
    Re: splitting a string on the / character <leekembel@hotmail.com>
    Re: splitting a string on the / character (Damian James)
    Re: splitting a string on the / character <uri@sysarch.com>
    Re: Threading in Perl <dan@tuatha.sidhe.org>
        When is an array @f allowed in a string? (Philip Hirschhorn)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 07 Feb 2001 15:10:55 +0000
From: Paul Boardman <peb@bms.umist.ac.uk>
Subject: Re: about dying
Message-Id: <3A81657F.4F768AF9@bms.umist.ac.uk>

> simply writing
> 
> die "Error!";
> 
> the way I've learned it doesn't show anything if I run the program from
> my www browser... it seems to work if I write
> 
> die print "Error!";
> 
> Is this also a correct way to do it?
> Why doesn't die work as is??

die prints to standard error.

how about having a subroutine called something like HTMLdie ?

sub HTMLdie{
	print "content-type: text/html\n\n";
	print "<h1>something went wrong!</h1>\n";
	print @_ if @_;
	exit;
}

you can then call this instead of using die & output specific error
messages depending on where in the script you call it from.

Paul


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

Date: Thu, 08 Feb 2001 04:39:29 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Another XML::Parser Question
Message-Id: <x7ofwdokji.fsf@home.sysarch.com>

>>>>> "G" == Godzilla!  <godzilla@stomp.stomp.tokyo> writes:

  G> There is an ancient sage saying,

  G> "If you want something done right, do it yourself."

  G> Write your own code rather than use a module.

hey moronzilla, let's see you back that up. write your own and publish
it. oh, i forgot you don't write code to share. that would be module. or
a library. or something that has been done in coding for 45 years. but
you wouldn't know about any of that. in fact the perl you profess to use
and love uses MODULES and LIBRARIES you can't stop it. so write an xml
parser already. write any parser. hey, you claim to know english, write
a universal language translator all by yourself. become rich and famous
instead of a bitch and infamous. your choice.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Thu, 08 Feb 2001 07:17:49 GMT
From: todd@designsouth.net
Subject: CGI.pm image upload probs
Message-Id: <95th6q$36t$1@nnrp1.deja.com>

I can get a file to upload, and I use the binary file code as specified
by the CGI docs:

$f = $cgi->param("image");
open (O,">../images/pics/$uid/$pic_id.jpg");
while ($bytesread=read($f,$buffer,1024)) {
      print O $buffer;
}

and the image ends up on the server, but only the top part of the image
looks good, then
the lower you go the more distorted it is, kind of like the picture on
a scrambled cable
channel.

What's wrong?


Sent via Deja.com
http://www.deja.com/


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

Date: Wed, 07 Feb 2001 19:47:38 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Devel DProf and " dprofpp "
Message-Id: <3A8216DA.7127CFB6@stomp.stomp.tokyo>

* silently curses *

Darn TechnoGeeksters and their gibberish...

I've figured out Devel DProf ok. It runs and
produces a useless document, tmon.out .. whoopie.

Documentation indicates to use dprofpp to
attain useful information from tmon.out file.

A search of perltoc yields:

Utility Changes
     dprofpp

A search of perlpod yields:

A tool like dprofpp, also supplied with the standard 
Perl distribution, can be used to interpret the 
information in that profile.

My search of our internet yields some vague references
on a message board about dprofpp spitting out useless
and tasteless garbage.

So, you TechnoGeeksters strike again with nonsense
documentation of zero worth.

* silently curses again *

What is dprofpp and how is it invoked and used?

A response of TechnoGeekster gibberish will earn
you a swift whack upside the head. Anyone out there
actually know anything about dprofpp and can explain
this feature in plain English? This is, discuss how
to use dprofpp in clear and concise terms?

Thanks, I think...

Godzilla!


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

Date: Thu, 08 Feb 2001 04:48:22 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Devel DProf and " dprofpp "
Message-Id: <x7itmlok4p.fsf@home.sysarch.com>

>>>>> "G" == Godzilla!  <godzilla@stomp.stomp.tokyo> writes:

  G> I've figured out Devel DProf ok. It runs and
  G> produces a useless document, tmon.out .. whoopie.

don't use those modules. they are meant to be used and share by people
who don't want to or can't write their own. you obviously can write
better code and don't need any prewritten stuff. 

  G> What is dprofpp and how is it invoked and used?

write your own. figure out how do to it all by yourself.

  G> Thanks, I think...

you don't even know how to ask for help without conditions.

go away and write all your own modules. don't try to use these. they
require a brain and a sense of community and sharing. since don't have
any of those, you cannot figure out how to use them. that is their
secret key which you will never learn.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Thu, 08 Feb 2001 06:12:59 GMT
From: nospam.newton@gmx.li (Philip 'Yes, that's my address' Newton)
Subject: Re: FAQ 3.28:   Where can I learn about object-oriented Perl programming?
Message-Id: <3a82387d.320566581@news.tiscalinet.de>

[Posted and cc'ed]

On Tue, 06 Feb 2001 13:17:01 GMT, PerlFAQ Server <faq@denver.pm.org>
wrote:

>   Where can I learn about object-oriented Perl programming?
> 
>     A good place to start is the perltoot manpage, and you can use the
>     perlobj manpage and the perlbot manpage for reference. Perltoot didn't
>     come out until the 5.004 release, but you can get a copy (in pod, html,
>     or postscript) from http://www.perl.com/CPAN/doc/FMTEYEWTK/ .

How about mentioning Damian's book in here?

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
The address above is repliable as-is. Do not remove anything.
If you're not part of the solution, you're part of the precipitate.


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

Date: Thu, 8 Feb 2001 14:56:15 +0800
From: "John Lin" <johnlin@chttl.com.tw>
Subject: flock unavailable on many platforms
Message-Id: <95tg1i$ip2@netnews.hinet.net>

Dear all,

All of my programs using flock (developed on WinNT) turned out
to fail when porting to HP-UX, SunOS and Dec (all perl 5.6).

I checked, the $Config{d_flock} on the OK platforms
is 'define' and on those failure platforms is undef.

According to perlport, flock is available on those platforms.
Is this a common problem that many people also encountered?
Or should I ask our system administrator to do something?
If this problem is caused by his mis-installation, could you
help us what we should take care if we want to re-install perl?

Thank you very much.

John Lin

P.S.

I use this program to test flock on those platforms.

use Fcntl ':flock';
$| = 1;
for(1..3) {
    fork;
    local *F;
    open F,'file.lock' or die "please create 'file.lock' first\n";
    print flock(F,LOCK_EX)? '#':'+';
    print sleep 1 for 1..3;
    print "\n";
}

If flock works, it will show

#111
#111
#111
#111
#111
#111
#111
#111
#111
#111
#111
#111
#111
#111

Yes, it does on my WinNT and freeBSD.
But on the other platforms, it shows

++111111

++++111111111
++111


++++++111111111111111111

111111










I hope the problem is not my testing program.





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

Date: Thu, 08 Feb 2001 04:44:27 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: hex to binary conversion ? Please help
Message-Id: <x7lmrhokb8.fsf@home.sysarch.com>

>>>>> "G" == Godzilla!  <godzilla@stomp.stomp.tokyo> writes:

  G> Uri, yes, Uri Guttman should purchase my domain
  G> name this year; he has earned this reward for
  G> all the wonderful attention he gives me!

it never was your domain. you just used it as a fake address. and i
wouldn't waste $.02 on bothering you. my favorite thought about you is
that your best punishment is being you, locked up in that psychotic
delusional skull for the rest of your life. maybe there is a slight
minor real personality struggling to get out but you keep drowning it in
false bravery and lies. in fact for a few short days you seemed to be
veering in the direction of minimal human functionality, but then you
did your usual hard u-turn back into your world of shit. live there and
stay out of here.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Wed, 07 Feb 2001 15:19:59 +0000
From: Paul Boardman <peb@bms.umist.ac.uk>
Subject: Re: how to remove item in the array?
Message-Id: <3A81679F.F3F5286B@bms.umist.ac.uk>

Hessu wrote:
> 
> problem is that checking trough whole array sucks all power
> and it's too slow way to do it anyway.
> can i do it with splice and how does this would work.
> 

could you post a description of the problem?

what type of data are you checking for?

Do you have for knowledge as to it's position in the array (if not
splice won't be a valid option unless you're talking about making
multiple arrays out of the original & searching through them)?

Paul


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

Date: Thu, 08 Feb 2001 08:38:06 +0100
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.li>
Subject: Re: Need Help Checking IP Address Syntax w/ PERL?
Message-Id: <kki48t088o6vq4h458kc683pigmc16tuu3@4ax.com>

[Removed alt.perl]

On Wed, 07 Feb 2001 02:11:58 -0000, Chris Stith <mischief@velma.motion.net>
wrote:

> die "not valid IP format\n" if ! /^\d+\.\d+\.\d+\.\d+$/;
> @ip=split /\./;
> 
> foreach (@ip) {
>     if (($_<=0) || ($_>=255)) {
>         die "IP octet $_ out of range\n";
>     }

$_ can't be less than 0, or it would start with '-', which doesn't match /\d+/
and so would have been rejected.

And what's wrong with 0 or 255 in the middle of an IP address?

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.


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

Date: Thu, 08 Feb 2001 08:38:07 +0100
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.li>
Subject: Re: Need Help Checking IP Address Syntax w/ PERL?
Message-Id: <3ni48tsau73rj33l3peh0ue2d5k9t1mm4g@4ax.com>

[Removed alt.perl]

On Tue, 6 Feb 2001 18:20:29 +0100, rpolzer@web.de (Rudolf Polzer) wrote:

> BTW: you could also use Socket and try
> 
> $ip = inet_ntoa ($ip);
> die "invalid address"
>  unless $ip;
> $ip = inet_aton ($ip);
> 
> This also resolves hostnames and removes leading zeroes.

It'll probably also resolve addresses like '127.1', which may be a good thing.

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.


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

Date: Thu, 08 Feb 2001 03:53:39 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Newbie - Perl for Win32 (Gasp!)
Message-Id: <3A8218E0.1FE419AE@rochester.rr.com>

TJ Pontious wrote:
> 
> I have Perl 5.6.0 installed on Windows 2000 server, and the command line
> runs scripts perfectly. However, when I submit a form from a web page, it
> displays the perl script instead of running the script.  Did I miss a
> setting I'm supposed to use somewhere in NT or IIS5 ?
> 
> [Yes, I know that Win32 thing makes me the oddball in a Unix/Linux world,
> but hey, somebody has to do it, right?]  Thanks.

You have a web server setup problem, not a Perl problem.  You might have
better luck in a web server newsgroup.  You should review the file types
in your web server setup, paying close attention to whatever file
extension you are using for your Perl programs (.pl, hopefully).  That
filename extension needs to be set up to run Perl.
-- 
Bob Walton


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

Date: Thu, 8 Feb 2001 16:00:55 +1300
From: "Peter Sundstrom" <peter.sundstrom-eds@eds.com>
Subject: Re: Newbie here please help!  Permission errors while creating directories.
Message-Id: <95t25a$51$1@hermes.nz.eds.com>


"Jason Hill" <jason.m.hill@usa.xerox.com> wrote in message
news:3A81AA1C.1BF5FF7B@usa.xerox.com...
> I am a beginning user of Perl, and think that it is a very useful
> language.  However I'm having trouble getting it to create a directory
> with the permissions that I desire.  (This is being done on a UNIX
> server).  I want the directory to have the permissions:
> User(ReadWriteExecute), Group(ReadExecute), World(ReadExecute).  Is the
> sample below the only commands that I need?  When I run this, the
> directory gets the permissions: User(WriteExecute), Group(Read),
> World(Execute).  What did I do wrong?  Do I need to use a different
> value, another command?  Thank for your help everyone.
>
> Here's a sample of what I am doing:
>
>  $dirname = \dica\server;
>  $mode = 755;    # Permissions for the directory
>   mkdir ($dirname, $mode);

mkdir $dirname, 0755 or die "Can not create $dirname $!\n";

perldoc -f umask




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

Date: Thu, 08 Feb 2001 04:09:22 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Package Positioning
Message-Id: <3A821C90.5D07A3F9@rochester.rr.com>

Christopher Hahn wrote:

> package SCUnixLog;
 ...
> This worked nicely. (Note: I did use theproper extension)
> 
> My question is: why does this fail when I put the module
> into the subdirectory:
> /usr/local/lib/perl5/site_perl/5.6.0/Peregrine
> 
> and change the script's use line:
> use Peregrine::SCUnixLog;
 ...
> Christopher
 ...

Hmmm...Would you have better luck after you move the files if the
package statement stated the new name of the package?:
    package Peregrine::SCUnixLog;
-- 
Bob Walton


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

Date: Thu, 08 Feb 2001 03:48:43 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Perl DBI newbie question ...
Message-Id: <3A8217B8.59B64A12@rochester.rr.com>

Joe Halbrook wrote:
> 
> I was curious about something:
> 
> When I run my script using telnet it works fine.
> When I call it from a browser, which loads a
> pop-up window, then does some DBI stuff,
> the pop-up works fine, but the DBI stuff blows.
> 
> Do I have to do something special when calling
> the script from a browser?
> 
 ...
> Joe
Well, when your code is run as a CGI script (which is probably what you
mean when say "run the script from a brower") the "user" under which it
is running is probably set to a different directory (it will be a
directory specified by your web server setup), and the database software
then can't find the database.  Try using the absolute file name. 
Depending on your OS, you may also have to adjust the permissions of the
database file so the "user" the web server runs it under has read/write
permission.
-- 
Bob Walton


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

Date: Thu, 08 Feb 2001 03:15:13 +0100
From: Mona Wuerz <wuerz@yahoo.com>
Subject: Re: Poetry in Perl ???
Message-Id: <080220010315138210%wuerz@yahoo.com>

In article <3a81f9e6.116050742@news>, maheshasolkar@yahoo.com (Mahesh
A) wrote:

[fixed the - how do they say - jeopardy quote]

> On Thu, 08 Feb 2001 00:36:38 +0100, Mona Wuerz <wuerz@yahoo.com>
> wrote:
>
> >@Numbers = split /[^\d]+/, $Str;

> Well,
> Pattern-matching is one of the many areas of perl I haven't got a

Ouch. I see you took the japh out of your signature at least.

> chance to work much with. I am trying hard to learn it... and what
> better way than consulting the knowledgeable !!

On my system, it's called Shuck, on your system, judging from your
header and from what I gather, it's probably called perldoc.

> The solution that I got almost worked. But there are a lot of NULLs in
> the array with the integers.

You didn't use copy and paste.

> my @Numbers = split /[^\d]/, $Str;

Please compare, correct, and run again.

> I'll sure come up with more problems after this is through!!

I think I won't be answering then.

-mona


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

Date: Wed, 07 Feb 2001 20:34:32 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Poetry in Perl ???
Message-Id: <3A8221D8.50EC0A41@stomp.stomp.tokyo>

Mahesh A wrote:

> Pattern-matching is one of the many areas of perl I haven't got a
> chance to work much with. I am trying hard to learn it... and what
> better way than consulting the knowledgeable !!

Cute joke.


> .... I want to bring all the integers - and only the integers - into
> an array, ....
 
> The solution that I got almost worked. But there are a lot of NULLs in
> the array with the integers.
 
(snipped)

> --- output ---
> 23,,,,,,24,,,,,,,,,,,856,,,,,,,1983,,,,86,


Under my signature.

Godzilla!
-- 

TEST SCRIPT:
____________

#!perl

print "Content-type: text/plain\n\n";

my ($str) = "23 this 24 delimiter 856 could 1983 be 86 anything";

$str =~ s/[^\d]+/¿/g;

@Array = split (/¿/, $str);

print "@Array";

exit;


PRINTED RESULTS:
________________

23 24 856 1983 86


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

Date: Thu, 08 Feb 2001 04:52:49 GMT
From: egwong@netcom.com
Subject: Re: Poetry in Perl ???
Message-Id: <BCpg6.645$y03.68337@news.flash.net>

Wyzelli <wyzelli@yahoo.com> wrote:
> "Mona Wuerz" <wuerz@yahoo.com> wrote:
>> , maheshasolkar@yahoo.com wrote:

>> > my $Str = "23 this 24 delimiter 856 could 1983 be 86 anything";
>> >
>> > This string has embedded integers. I, however, don't know how many
> integers
>> > would be emedded in a string. I want to bring all the integers into
> an array,
>> > which would look like ...
>> >
>> > @Numbers = (23, 24, 856, 1983, 86);

>> @Numbers = split /[^\d]+/, $Str;

> @Numbers = $Str =~ /(\d+)/g;

$_ = "23 this 24 delimiter 856 could 1983 be 86 anything";
@numbers = grep 0+$_, split;

'Course it won't work for '0'.  But on the bright side, it'll pass
negative integers just fine!


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

Date: Thu, 08 Feb 2001 06:08:34 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Poetry in Perl ???
Message-Id: <CJqg6.153$M8.188493312@news.frii.net>

In article <3A8221D8.50EC0A41@stomp.stomp.tokyo>,
Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
>Mahesh A wrote:
>
>> Pattern-matching is one of the many areas of perl I haven't got a
>> chance to work much with. I am trying hard to learn it... and what
>> better way than consulting the knowledgeable !!
>
>Cute joke.
>

80% of usenet postings are junk for the same reason that 80% of commercial
TV is junk. 

>
>Under my signature.
>
>Godzilla!
>-- 
>#!perl
>print "Content-type: text/plain\n\n";
>my ($str) = "23 this 24 delimiter 856 could 1983 be 86 anything";
>$str =~ s/[^\d]+/¿/g;
>@Array = split (/¿/, $str);
>print "@Array";
>exit;

Oh great mudpuppy.  Correct solutions already have already been posted.
Could it be that this is troll food? 

I await your judgement
chris
-- 
    This space intentionally left blank


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

Date: Thu, 08 Feb 2001 05:51:09 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Radical readdir suggestion
Message-Id: <htqg6.151$M8.170904064@news.frii.net>

In article <ldo-075172.21190407022001@news.wave.co.nz>,
Lawrence D¹Oliveiro  <ldo@geek-central.gen.new_zealand> wrote:
>In article <3a7e6526.4cce$d8@news.op.net>, mjd@plover.com (Mark Jason 
>Dominus) wrote:
>
>>In article <ldo-BD3CE2.16005405022001@news.wave.co.nz>,
>>Lawrence D¹Oliveiro  <ldo@geek-central.gen.new_zealand> wrote:
>>>What is the use of readdir returning the "." and ".." entries? 
>>
>>The Principle of Least Surprise.
>
>In what way?
>

Not to put words into mjd's mouth but...
Given that perl grew up on unix it's not surprising that it makes a few
assumptions that reflect that heritage. This particular example seems kind of
trivial though.

>>>Has anybody ever written a Perl script that depended on these entries
>>>being returned in order to work?
>>
>>Yes.
>
>Such as...?

Relative paths are an integral part of working on unix.  It would be
astonishing if something came out of find2perl that did not work correctly
when given them to work on. 
-- 
    This space intentionally left blank


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

Date: 8 Feb 2001 00:30:42 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Re: Setting Cookie Expiration Date with Perl
Message-Id: <981592241.143133@hpvablab.cup.hp.com>

Kevin Diffily <kdiffily@webpageweaver.com> writes:
>I am trying to set a variable for cookie expiration dates.  The amount of
>time in the future will be x number of days from the date that the cookie is
>set.  I found some helpful postings at deja.com but am having a little
>trouble with the correct formatting for the date.  The relevant parts of the
>script follow:

Have you looked at the Perl CGI module's documentation for cookies?  You
don't have to compute an exact GMT date, you can specify relative dates.

Rich
-- 
Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
Technical Consultant     | I speak for me,     |   19055 Pruneridge Ave. 
Development Alliances Lab|            *not* HP |                MS 46TU2
ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014


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

Date: Thu, 08 Feb 2001 02:32:50 GMT
From: "Studio 51" <leekembel@hotmail.com>
Subject: Re: splitting a string on the / character
Message-Id: <mzng6.103838$V22.21007667@news4.rdc1.on.home.com>

"Uri Guttman" <uri@sysarch.com> wrote in message
news:x7wvb2nhey.fsf@home.sysarch.com...
> and that is a lousy way to do it. leaning toothpick syndrome. typical of
> a simple but poor answer.

It's one character, who gives a damn if it looks like a stack of toothpicks.
I agree that a mess of slashes looks horrible, but we're talking about ONE
character. It is not hard to read, it is simple, it does EXACTLY what is
needed, and I would be surprised if there were an alternate way that takes
less code or is easier to understand. Besides, if you REALLY don't like
slashes, use this:

my @temp = split "\/", $direntry;

> and you should probably read them yourself. someone else posted the
> better way of using alternate delimiters.

Better way? Besides the fact that it's more code to type compared to adding
a simple \, you now have to worry about whether or not your alternate
delimiter was used in your original string. Besides, there is no "better
way". If you think that way is "better" then use it. I think my way is
"better" for me so that's how I'll do it, and how I'll recommend to others
to do it. Neither one is any better, they both do the same thing.

> someone throw this guy a stinking fish. he will never become a fisherman.

My point is that a lot of "helpful" replies seem to just be "read the man
pages". That is not helpful, and if that's all you have to add then why
bother posting it? When people ask simple questions give a simple answer,
that's all I'm trying to say. It seemed like everyone knew the answer, but
no one wanted to come out and say "This is how you do it and why".


-S51




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

Date: 8 Feb 2001 03:07:58 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: splitting a string on the / character
Message-Id: <slrn9843cc.l7g.damian@puma.qimr.edu.au>

Thus spake Studio 51 on Thu, 08 Feb 2001 02:32:50 GMT:
>"Uri Guttman" <uri@sysarch.com> wrote in message
>news:x7wvb2nhey.fsf@home.sysarch.com...
>>
>> someone throw this guy a stinking fish. he will never become a fisherman.
>
>My point is that a lot of "helpful" replies seem to just be "read the man
>pages". That is not helpful...

On the contrary, pointing out exactly which man page to read is
considerably more helpful than giving a simple solution. Usually the
problem is not that the OP can't work it out, but that they don't know
HOW to work it out. Pointing to the appropriate man page shows them how.


>...and if that's all you have to add then why
>bother posting it? When people ask simple questions give a simple answer,
>that's all I'm trying to say. It seemed like everyone knew the answer, but
>no one wanted to come out and say "This is how you do it and why".
>

For GOOD reasons. People need to know that the first reference is the docs.
There simply is no other way to go about this.

I guess you missed the voluminous thread last week about fish and fishing?

Cheers,
Damian
-- 
$;=ord$%,$:=$;-ord q,.,,$_=q 13346:3366:3276:3326:3386:546:566:966:3396:3376:1.
q 73386:546:;96:3326:3336:3386:3266:3236:3366:546::26:3236:3366:32:6:546:32667.
q,:;96:;;6:3296:3236:3366:326:56,,s,.,;ord($&)-$:-$;;;,eg,s,$;,;;;chr$&-$:;,eg,
eval eval;               #requires 5.6.0 ## my first attempt at one of these...


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

Date: Thu, 08 Feb 2001 04:32:08 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: splitting a string on the / character
Message-Id: <x7r919okvs.fsf@home.sysarch.com>

>>>>> "DJ" == Damian James <damian@qimr.edu.au> writes:

  DJ> I guess you missed the voluminous thread last week about fish and
  DJ> fishing?

hence my comment on his never becoming a fisherman. don't waste your
time. he is another in the long line of whiners who say "why don't you
give the easy answer?" and then never help anyone themselves. i expect to
see this guy answering ALL newbie posts with correct, polite and useful
answers for the next two weeks. the rest of us and the manuals can take
that time off and be nasty elsewhere.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Thu, 08 Feb 2001 03:05:54 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Threading in Perl
Message-Id: <m2og6.174668$P82.21363926@news1.rdc1.ct.home.com>

Andrew Ralph <andrew_ralph@yahoo.com> wrote:
> Hi,

> I "inherited" some code that uses unix forking and I now need to port this
> to windows.

Perl 5.6.0 fakes fork on windows--it may be enough for you to do what you
need to.

					Dan


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

Date: 08 Feb 2001 07:43:47 GMT
From: psh@math.mit.edu (Philip Hirschhorn)
Subject: When is an array @f allowed in a string?
Message-Id: <3a824e33$0$17470$b45e6eb0@senator-bedfellow.mit.edu>

My apologies for asking a question that I should probably able to
remember where I've seen answered before, but I'm stumped.  If I run
the script

--------------------------------------------------------------------
#! /usr/bin/perl -w

&makepoly;
print "f = @f\n";
exit(0);

sub makepoly {
    $f[0] = 0;
    $f[1] = 1;
    $f[2] = 2;
} # makepoly
--------------------------------------------------------------------

Then I get the error mesage:

In string, @f now must be written as \@f at printtest line 4, near "f = @f"
Execution of printtest aborted due to compilation errors.

However, if I add the line

@f = (5, 6);

just above the call to makepoly, there are no error messages and the
output is:

f = 0 1 2

Apparently perl doesn't look ahead to see that makepoly defines the
array @f and it assumes I mean to type the actual character @ followed
by an f.

Can anyone explain when perl believes that @f inside a string means
"interpolate the array @f" and when it assumes that you just wanted to
have those two characters there?  I'd appreciate a reference to
wherever I can read about this.

My thanks for any help on this.

Phil Hirschhorn

--
----------------------------------------------------------------------
Philip Hirschhorn          psh@math.mit.edu
                           psh@poincare.wellesley.edu
----------------------------------------------------------------------


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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


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