[12426] in Perl-Users-Digest
Perl-Users Digest, Issue: 6026 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 16 23:07:30 1999
Date: Wed, 16 Jun 99 20:00:21 -0700
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, 16 Jun 1999 Volume: 8 Number: 6026
Today's topics:
Re: $_ and $@ - What are they? <rick.delaney@home.com>
Re: 'and' problem (Larry Rosler)
Re: ANNOUNCE Perl 5.005_02 Documentation in HTMLHelp fo (Doug Edmunds)
Re: Bit Twiddling Troubles <whm10@amdahl.com>
Re: Can anyone explain this behavior? (brian d foy)
Re: CGI:pm error message <rootbeer@redcat.com>
Re: concatenate lines in a group of files (Andrew Allen)
Re: how to connect to an Oracle database via a cgi scri <tamoore1@gte.net>
howto delete an array of hash <luj@carbon.dmpc.com>
Inclusive Split <anonymous@web.remarq.com>
Re: Inclusive Split <anonymous@web.remarq.com>
Re: Inclusive Split (Mark-Jason Dominus)
Re: Inclusive Split <rootbeer@redcat.com>
Re: Is it better perl than awk ? <HrlnGrv@aol.com>
Re: newbie learning "my" declarations <rootbeer@redcat.com>
Re: print command (<<) in perl CGI <rootbeer@redcat.com>
Re: problems receiving datastream via a socket <rootbeer@redcat.com>
Re: Real perl Y2K bug! <rootbeer@redcat.com>
Re: Regex question <eweiss@winchendon.com>
Re: s and tr (Mark-Jason Dominus)
Re: saving uploaded file <upsetter@ziplink.net>
Re: saving uploaded file <rootbeer@redcat.com>
simple quesiotn about array <sydney@netwave.ca>
simple question about array <sydney@netwave.ca>
Re: simple question about array (Mark-Jason Dominus)
Re: simple question about array <rootbeer@redcat.com>
system call as another user (Steve .)
Re: this charecter @ ruined my day!! zenin@bawdycaste.org
Re: understanding 'You need to quote "sub" at..' <rootbeer@redcat.com>
Re: Win32 select() (David Whitmarsh)
Re: Win32::NetAdmin <chirstius@mediaone.net>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 17 Jun 1999 01:03:23 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: $_ and $@ - What are they?
Message-Id: <37684919.88AAB25B@home.com>
[posted & mailed]
Casey Tweten wrote:
>
> I have read every line of it, perhaps you should too.
Good for you! Now read the useful documents at news.announce.newusers
and you'll be set.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Wed, 16 Jun 1999 18:37:46 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: 'and' problem
Message-Id: <MPG.11d1f1436b8f28b3989bf2@nntp.hpl.hp.com>
In article <3767bf15@news.uk.ibm.net> on Wed, 16 Jun 1999 18:16:54
+0200, Vincent Vanbiervliet <vincent_vanbiervliet@be.ibm.com> says...
...
> And the really last remark is this:
> if you have a line saying something like:
> if (<condition>) {<one line of code>}
> you can write it like:
> <one line of code> if <condition>
> This frees you of all {,},( and )'s
> (The same goes for unless).
> So your code could become (if the 'exit' wouldn't have been there, that is,
> but maybe you could write the 'exit' in the function you're calling):
> &error_html_query_form unless (length($form_data{name}) or
> length($form_data{more_info}));
As you've gone to so much trouble to trim the code down, save even more
punctuation:
&error_html_query_form unless
length $form_data{name} || length $form_data{more_info};
> This frees you of all {,},( and )'s
Now your statement is true.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 17 Jun 1999 01:48:56 GMT
From: dae_alt@juno.com (Doug Edmunds)
Subject: Re: ANNOUNCE Perl 5.005_02 Documentation in HTMLHelp format
Message-Id: <37685201.40224318@news.pacifier.com>
The link to file on the cited www page has been fixed.
Direct link to Perl documentation in HTMLHelp format is
http://www.pacifier.com/~edmunds/PHH5_005_02.zip
Sorry 'bout that
D Edmunds
16 June 1999
edmundsREMOVETHECAPS@pacifier.com
------------------------------
Date: Wed, 16 Jun 1999 18:08:00 -0700
From: Hal Mounce <whm10@amdahl.com>
To: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Bit Twiddling Troubles
Message-Id: <37684A70.937EF529@amdahl.com>
Tom Phoenix wrote:
> You should probably 'use strict' and put quotes around that L. But you
> should even more probably use N instead of L (or see the perlfunc manpage
> to learn why I say that, at least).
I'll look into the pragma. The N is exactly what I want, thanks. I
spent hours trying to figure out how to guarantee a 4 byte, big endian
result without having to ugly up the code. I gave up and was using L
"for now."
> You seem to want a string, so maybe that number
> should be replaced with "\xC0\0\0\0".
Way cool, thanks again.
It sure was easier to do this stuff in assembler. A small price to pay,
however, considering I've written and debugged six months worth of code
in the past week and a half.
--Hal
------------------------------
Date: Wed, 16 Jun 1999 22:46:48 -0400
From: brian@pm.org (brian d foy)
Subject: Re: Can anyone explain this behavior?
Message-Id: <brian-ya02408000R1606992246480001@news.panix.com>
In article <376bac20.21658740@news.skynet.be>, bart.lateur@skynet.be (Bart Lateur) posted:
> Larry Rosler wrote:
>
> >The other guys explained it, but they didn't give you the simplest
> >solution -- change the 2 to 3.
>
> No. The simplest solution would be to drop the ",2".
>
> If the guy wants a split limit, it's probably for a reason.
neither of those work if the data looks something like:
123456789 This is the title
where the 123456789 is the first piece and 'This is the title' is
the second piece.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: Wed, 16 Jun 1999 18:30:44 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: CGI:pm error message
Message-Id: <Pine.GSO.4.02A.9906161819580.26850-100000@user1.teleport.com>
On Wed, 16 Jun 1999, Mahlon Smith wrote:
> The error is
> Args must match #! line at [scriptname] line 1.
This is in the perldiag manpage. Your program is being run set-id,
somehow, and it's getting different args than the shebang line says. Perl
is trying to keep from ruining your day with a security hole. Maybe you
have a set-id bit set, or maybe there's some wrapper running your program
this way.
> please remove the 'pants' from my address to reply.
Sir! I hardly know you!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 17 Jun 1999 01:10:45 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: concatenate lines in a group of files
Message-Id: <7k9hul$i97$1@fcnews.fc.hp.com>
Maury (mej014@my-deja.com) wrote:
: I wrote a script which takes a group of text files as input and
: concatenates lines in each file if the first character in the line is a
: '+', then writes the altered files back out. In other words, the file:
: I couldn't escape the feeling while I was writing the script that there
: was an elegant solution, perhaps even a succinct one-line hack, but,
perl -pe 'chomp unless eof;print "\n" unless $.==1 or s/^\+//;'
Andrew
------------------------------
Date: Thu, 17 Jun 1999 02:58:05 GMT
From: Todd Moore <tamoore1@gte.net>
Subject: Re: how to connect to an Oracle database via a cgi script writtenin Perl
Message-Id: <3768636C.4D9D2B79@gte.net>
I have a directory on the server that can be accessed via a URL. Within that
directory I make a cgi-bin directory and put my scripts in there. Where
should I install the DBD::Oracle module? Is there a DBI that also has to be
installed? If so, can that be installed in my directory also?
Thanks...
Todd
Tom Phoenix wrote:
> On Wed, 16 Jun 1999, Todd Moore wrote:
>
> > Does anyone know how to connect to an Oracle database via a cgi script
> > written in Perl
>
> The same way you do so from a non-cgi script.
>
> > without using DBD:Oracle or Oraperl?
>
> This is like asking how to get from Hawaii to Kansas without using an
> airplane. You _can_ do without, but you probably shouldn't try.
>
> > Can it be done using SQL*Plus?
>
> Maybe you should check with the docs, FAQs, and newsgroups about SQL*Plus.
>
> > I can't install DBD:Oracle or Oraperl or any module...because I'm not
> > the server administrator.
>
> You don't have to be the system administrator to install modules, but it
> helps. (If you can't install the module, how could you install code which
> does what the module does?)
>
> > They're not very cooperative.
>
> Who, the system administrators? If your sysadmin can't or won't install
> software, upgrade. But maybe you're not applying the proper amount of
> pizza and beer. Admins respond well to such things.
>
> Good luck!
>
> --
> Tom Phoenix Perl Training and Hacking Esperanto
> Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 16 Jun 1999 21:21:34 -0400
From: Jin Lu <luj@carbon.dmpc.com>
Subject: howto delete an array of hash
Message-Id: <Pine.SOL.4.10.9906162105550.16293-100000@mainsail>
HI,
I really need to delete one slice of an array of hash or hash key words.
I don't know whether undef works or not.
e.g. I have a array of hash, such as $array[$n]{$key}=value.
Could I delete the whole slice $n, like this $array[$n]=()?
or I have to delete each $key inside of $array[$n] so that I could null
return of %{$array[$n]}?
Many thanks if you can shed some lights on how to delete or nullify the
array of hash data structure.
Sincerely,
Jin
Jin Lu
Dupont Pharmaceuticals
Experimental Station E336/259
Wilmington, DE 19880
Phone: 302-695-6727
FAX: 302-695-9420
email: JIN.LU@dupontpharma.com
------------------------------
Date: Wed, 16 Jun 1999 17:32:40 -0800
From: Ashish Kadakia <anonymous@web.remarq.com>
Subject: Inclusive Split
Message-Id: <929583162.6922@www.remarq.com>
Hi, I have simple split question:
I have the data in variable in form of
$itemstring = "<X>itemA1</X> <Y>itemA2</Y> <X>itemB1</X>
<Y>itemB2</Y>............".
I want to put this data in array
@item1 = (itemA1,itemB1,itemC1,..);
%item2 = (itemA1,itemA2,itemB1,itemB2...)
In $itemstring there may or many not be "space" between
</X> and <Y> or between </Y> and <X>
Please help me.
Thanks
**** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ****
------------------------------
Date: Wed, 16 Jun 1999 18:02:25 -0800
From: Ashish Kadakia <anonymous@web.remarq.com>
Subject: Re: Inclusive Split
Message-Id: <929584947.7120@www.remarq.com>
some how it deleted angle brackets in original post..while
posting..
I will repost here..
I have the data:
$items = "STARTX itemA1 ENDX STARTY itemA2 ENDY STARTX
itemB1 ENDX STARTY itemB2 ENDY STARTX itemC1 ENDX STARTY
itemC2 ENDY"
I would like to have following
@item1 = (itemA1,itemB1,itemC1)
%item2 = (itemA1,itemA2,itemB1,itemB2,itemC1,itemC2)
The problem is that The number of spaces between ENDY and
STARTX can be 0 or more. Samething applies to between ENDX
and STARTY
How do I solve it? (anything using grep or map or split is
fine.. or anything else)
Thanks
ANK
**** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ****
------------------------------
Date: Thu, 17 Jun 1999 02:09:18 GMT
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Inclusive Split
Message-Id: <7k9l9s$d6p$1@monet.op.net>
In article <929583162.6922@www.remarq.com>,
Ashish Kadakia <anonymous@web.remarq.com> wrote:
>Hi, I have simple split question:
>I have the data in variable in form of
>
>$itemstring = "<X>itemA1</X> <Y>itemA2</Y> <X>itemB1</X>
><Y>itemB2</Y>............".
>
>I want to put this data in array
>@item1 = (itemA1,itemB1,itemC1,..);
>%item2 = (itemA1,itemA2,itemB1,itemB2...)
%item2 =
$itemstring =~
m{
<X>
([^<]*)
</X>
\s*
<Y>
([^<]*)
</Y>
}gsx;
@item1 = keys %item2;
This supposes that the items won't contain < characters. If that
isn't the case, you will have to replace the [^<] expressions with
something more complicated.
------------------------------
Date: Wed, 16 Jun 1999 19:37:26 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Inclusive Split
Message-Id: <Pine.GSO.4.02A.9906161929210.26850-100000@user1.teleport.com>
On Wed, 16 Jun 1999, Ashish Kadakia wrote:
> I have the data in variable in form of
>
> $itemstring = "<X>itemA1</X> <Y>itemA2</Y> <X>itemB1</X>
> <Y>itemB2</Y>............".
Is it really X and Y, or do you have HTML (SGML?) tags there? You may need
a real parser to do this correctly. But I'll presume that you want tags
just as you said... :-)
> I want to put this data in array
> @item1 = (itemA1,itemB1,itemC1,..);
> %item2 = (itemA1,itemA2,itemB1,itemB2...)
So, you want to pull out an X and Y pair of items at a time.
> In $itemstring there may or many not be "space" between
> </X> and <Y> or between </Y> and <X>
So, your pattern match should allow for this. I recommend making a loop
something like this untested code.
while ($item_string =~
m{
\G # From where we left off, find...
\s* # optional whitespace chars
<X> # The X tag
\s* # optional whitespace chars
(.*?) # Memory 1 (the X part)
\s* # optional whitespace chars
</X> #
\s* # optional whitespace chars
<Y> # The Y tag
\s* # optional whitespace chars
(.*?) # Memory 2 (the Y part)
\s* # optional whitespace chars
</Y> #
}gsx
) {
my($x, $y) = ($1, $2);
push @item1, $x;
$item2{$x} = $y;
}
Of course, this is hopelessly inadequate if you need a real parser like
HTML::Parser. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 17 Jun 1999 01:18:30 GMT
From: Harlan Grove <HrlnGrv@aol.com>
Subject: Re: Is it better perl than awk ?
Message-Id: <7k9icu$59t$1@nnrp1.deja.com>
In article <3766d292.0@omega>,
"Claudio Gutierrez" <cgutierr@firstcom.cl> wrote:
>As this news are read by people with a problem similar to mine
>currently solved, I ask the referenced question. I don4t attempt to
>begin a philosophical discussion, . . .
You failed utterly in this regard.
> . . . I just would like to know if it is
>better to invest time to learn perl or awk to solve the next
>situation what is not cleared after reading the Introduction of
>Sed&awk and Learning Perl, because both books say awk and perl are
>reporting languages.
There are some people who say 'learn perl, it does everything awk & sed
do, so why waste time learning awk and sed.' And to be fair, there are
some people (like me) who don't use sed because awk can do everything
sed can. Awk & sed enthusiasts tend to become defensive when their
favorites are called obsolete or overblown cat replacements.
Despite some perl enthusiats' responses, awk is a much smaller language
than perl, so it should take less time to gain a working knowledge of
awk than perl. The tricky thing about awk is it's implicit input loop.
>I have log files from a RADIUS server, about 10MB daily. I need to
>process such files to get info like: users connected a day, duration
>of each connection of each user an so on.
>
>Then:
>awk is capable to deal quickly with such relatively huge files or I
>need perl? the searching and reporting is better in awk or perl?
>Any hints, clues, gotchas will be appreciated.
This would be no problem for GNU awk (usually called gawk), though some
OS-supplied awks might choke on this volume of data.
Perl has a facility for creating report layouts using a crude WYSIWYG
approach kinda like BASIC's PRINT USING formats. Awk has nothing like
this. Awk and perl both support C-like printf formatted output.
Basically, awk and perl are probably not much different in performance
and number of statements (if perl is set to work like awk) when it
comes to generating reports from text files. The big difference between
perl and awk is in dealing with things other than text file processing.
Perl can handle many, many things that awk can't.
Jumping into the language wars, to get absolutely reductive, nothing
beats assembler for absolute breadth - not even perl or C. Pity it
isn't portable. Finally, awk does more PER BYTE OF STORAGE TAKEN UP BY
ITS BINARY EXECUTABLE than perl does. If you have to work with limited
storage (as some of us still do on occasion), awk is viable many times
when perl isn't - eg, awk can run on MS-DOS systems, perl can't.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 16 Jun 1999 18:44:52 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: newbie learning "my" declarations
Message-Id: <Pine.GSO.4.02A.9906161831550.26850-100000@user1.teleport.com>
On Wed, 16 Jun 1999, Lee wrote:
> >Incrementing from undef to one is
> >a legitimate operation in the world of Perl.
>
> Incrementing undef is conceptually different from adding one to it?
Well, incrementing a variable (even one which happens to contain undef) is
conceptually different from taking a value of undef and adding one to it.
In one case, you're working with a variable; in the other, with a value.
Does it help any to look at it that way? Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 16 Jun 1999 19:07:36 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: print command (<<) in perl CGI
Message-Id: <Pine.GSO.4.02A.9906161859450.26850-100000@user1.teleport.com>
On Wed, 16 Jun 1999, Allan Masri wrote:
> I can't get the same perl script that runs fine on
> unix to run on NT with ActivePerl. Sheesh!
Did you properly transfer it from Unix to NT? Thou shalt not transfer text
files as binaries, nor binaries as text files.
If you're not sure, either transfer it again or try something like this:
perl -pi.bak -e "s/\x0D?\x0A/\x0D\x0A/g" bad_file.plx
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 16 Jun 1999 18:49:50 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: problems receiving datastream via a socket
Message-Id: <Pine.GSO.4.02A.9906161848160.26850-100000@user1.teleport.com>
On Wed, 16 Jun 1999, trader wrote:
> united parcel service has an on-line shipping calculator where you can
> post some variables about a shipment and it will return the shipping
> cost. in the instructions ups provides, there's a perl script that
> supposedly can be implemented so you don't have to access their cgi
> through a web browser. here's a snippet of the code they've supplied:
>
> $AF_INET = 2;
> $SOCK_STREAM = 2;
> $sockaddr = "S n a4 x8";
They should really be using LWP::Simple.
> $workString .= "accept_UPS_license_agreement=yes";
Nice of them to accept that for you...
Try LWP::Simple, and you'll probably be able to do this more easily. Good
luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 16 Jun 1999 18:58:26 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Real perl Y2K bug!
Message-Id: <Pine.GSO.4.02A.9906161857330.26850-100000@user1.teleport.com>
On Wed, 16 Jun 1999, Bill wrote:
> Subject: Real perl Y2K bug!
> My Perl version is 5.005.
Well, don't worry about Y2K until you 1994.995 more versions, then.
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 16 Jun 1999 22:28:34 -0400
From: Eric Weiss <eweiss@winchendon.com>
Subject: Re: Regex question
Message-Id: <37685D52.C9D498E0@winchendon.com>
Jody,
Instead of trying to do everything in an elegant expression, try doing
it in
pieces. Match Tue, Jun, 15 and 1999. Be more specific with a series
like:
s/^(\w\w\w \w\w\w \d\d) .* (\d\d\d\d)$/
So you've got $1 and $2 which have what you want. Concat them together
or
whatever.
Play with this to get a better idea of how these things work.
Regex match as much as possible, so you have to skip the time to get
what
you want.
Eric
PS--I did not test this regular expression, so there might be an error
in it,
but the key point is that you have to jump over the time. As usual
There's
More Than One Way To Do It In Perl.
Eric
Jody Fedor wrote:
>
> Ok.. I'm bashing my head in the wall here... I've look and read perldoc
> perlre...
> I've looked in my perl books and just can't understand this:
>
> $date=localtime;
>
> My $date variable now has Tue Jun 15 00:10:02 1999.
>
> I would like $date to have Tue Jun 15 1999.
>
> I came up with $date =~ s/(\w+{4}?)//;
>
> (My thinking \w matches first letter in word adding + matches whole word,
> using () because of grouping using {4} because perlre says to and ? because
> it could be anything.)
>
> I think the regex would match the 4th whole word and replace it with
> nothing. I doesn't work but I don't understand why not. I have been
> reading "Mastering Regular Expressions" but for an old GW Basic programmer
> this is a hard concept to grasp. It's very complicated and I don't have any
> friends who know Perl except you guys and gals.
>
> Please help me.
>
> Jody
------------------------------
Date: Thu, 17 Jun 1999 01:37:36 GMT
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: s and tr
Message-Id: <7k9jfo$cs0$1@monet.op.net>
In article <7k9cep$r8d$1@news.monmouth.com>,
Matt <splinter@monmouth.com> wrote:
>so what would someone suggest I use to remove a record like this in a
>text file?
See perlfaq5, ``How do I delete a line in a file.''
------------------------------
Date: Thu, 17 Jun 1999 01:31:57 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: saving uploaded file
Message-Id: <heY93.152$7X1.35825@news.shore.net>
Ryan Corder <uucon@my-deja.com> wrote:
: I'm new to perl, how do i use this?
perldoc File::Basename
--Art
: ryan
: In article <Pine.GSO.4.02A.9906161340230.26850-100000@user1.teleport.com>,
: Tom Phoenix <rootbeer@redcat.com> wrote:
:> On Wed, 16 Jun 1999, Ryan Corder wrote:
:>
:> > Now, how do i strip the path from $filename so i can specify the file
:> > to be saved in a specific directory?
:>
:> Use File::Basename. Cheers!
:>
:> --
:> Tom Phoenix Perl Training and Hacking Esperanto
:> Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
:>
:>
: Sent via Deja.com http://www.deja.com/
: Share what you know. Learn what you don't.
--
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: Wed, 16 Jun 1999 18:52:54 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: saving uploaded file
Message-Id: <Pine.GSO.4.02A.9906161850530.26850-100000@user1.teleport.com>
On Wed, 16 Jun 1999, Ryan Corder wrote:
> > Use File::Basename.
> I'm new to perl, how do i use this?
Start with the perldoc command, as in these examples.
perldoc perldoc
perldoc perl
perldoc File::Basename
If that command isn't working on your system, replace 'perldoc' with 'man'
and try again. But chances are that you'll need to ask your system
administrator to properly (re)install Perl if perldoc doesn't get you the
manuals. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 16 Jun 1999 21:19:08 -0400
From: sydney qiu <sydney@netwave.ca>
Subject: simple quesiotn about array
Message-Id: <37684D0C.1806D0F0@netwave.ca>
Hi, I am a beginner of perl. I basiclly teach myself from
--
Time to get up and have a walk outside
------------------------------
Date: Wed, 16 Jun 1999 21:24:49 -0400
From: sydney qiu <sydney@netwave.ca>
Subject: simple question about array
Message-Id: <37684E61.1C2D1F65@netwave.ca>
Hi, I am a beginner of perl and basiclly teaching myself from the book
Learning Perl. In chapter there is an example @array=(1.3 .. 6.1) is
equal to (1.3, 2.3, 3.3,4.3, 5.3)
however I tried this out on my system and I got (1,2,3,4,5,6)
Can anyone tell me what is happenning here?
Thanks in advance.
Sydney Qiu
sydney@netwave.ca
--
Time to get up and have a walk outside
------------------------------
Date: Thu, 17 Jun 1999 01:57:26 GMT
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: simple question about array
Message-Id: <7k9kku$d38$1@monet.op.net>
In article <37684E61.1C2D1F65@netwave.ca>,
sydney qiu <sydney@netwave.ca> wrote:
>Hi, I am a beginner of perl and basiclly teaching myself from the book
>Learning Perl. In chapter there is an example @array=(1.3 .. 6.1) is
>equal to (1.3, 2.3, 3.3,4.3, 5.3)
>however I tried this out on my system and I got (1,2,3,4,5,6)
>Can anyone tell me what is happenning here?
The 1.3 and 6.1 are truncated to integers so that asking for
(1.3 .. 6.1) is the same as asking for (1 .. 6).
The book is mistaken.
------------------------------
Date: Wed, 16 Jun 1999 19:28:31 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: simple question about array
Message-Id: <Pine.GSO.4.02A.9906161918060.26850-100000@user1.teleport.com>
On Wed, 16 Jun 1999, sydney qiu wrote:
> Hi, I am a beginner of perl and basiclly teaching myself from the book
> Learning Perl. In chapter there is an example @array=(1.3 .. 6.1) is
> equal to (1.3, 2.3, 3.3,4.3, 5.3)
> however I tried this out on my system and I got (1,2,3,4,5,6)
> Can anyone tell me what is happenning here?
The book is mistaken, alas. You're doing it right, though. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 17 Jun 1999 02:40:20 GMT
From: syarbrou@nospam.enteract.com (Steve .)
Subject: system call as another user
Message-Id: <37685f92.3963230@news.enteract.com>
I have a routine below that uses the open3 function. I want the
call to be run as another user. How do you do this? THis is running
on a unix system. Thanks.
Steve(newsgroup responses prefered. Remove nospam if thru email)
------ snip ----
my $pid = open3 (\*PGP_WRITE, \*PGP_READ, \*PGP_ERR,
qq|/usr/sbin/webmirror.sh $data{'path'}|);
------------------------------
Date: 17 Jun 1999 01:56:02 GMT
From: zenin@bawdycaste.org
Subject: Re: this charecter @ ruined my day!!
Message-Id: <929584757.575111@thrush.omix.com>
Lucifer Bonaventure <revjack@radix.net> wrote:
: Tom Christiansen explains it all:
:
: :Give up now. If you can't get at your own errors, there's really
: :very little hope.
:
: Lack of access to logs (of any kind) is more widespread than one might
: think, especially with the popularity of those quickie we-host-4-U web
: hosting companies. Anticipate more and more of these pleas.
#!/usr/local/bin/perl -w
use strict;
use CGI::Carp qw(fatalsToBrowser);
: One could rightly criticise the administators of such services for their
: decision not to make the logs readily available to developers. And, one
: could criticise people who patronize these services.
Yes, very much so on both points.
: But they're there, and there are lots of them, and there are likely to be
: more.
And no one here is required to support them and very few would
likely even be inclined too.
: Patrons of these services will always need some poor schmoe (like me) to
: develop their feedback forms, flat-file databases, bulletin boards, search
: engines, etc., without the benefit of log access. It pays the bills.
http://www.apache.org/
Get your own local web (or whatever) server and write your code on
that.
This:
Edit->FTP->Reload->Guess at reason for error->Edit->FTP...
Is no way for anyone to code, much less someone doing it for pay as
you're at least wasting your time and likely your client's as well.
: Fortunately, there *are* ways to develop and debug given only the HTTP
: protocol. How to achieve this sort of one-eyed development may already be
: a FAQ, I don't know. I'm too lazy to look.
:
: Probably has something to do with one of those module thingies.
--
-Zenin (zenin@archive.rhps.org) "Hey, are you one of those Linux coders?"
"Nyet. Linux coder in next office."
"Good man. Ignore the screams."
--www.userfriendly.org
------------------------------
Date: Wed, 16 Jun 1999 19:15:34 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: understanding 'You need to quote "sub" at..'
Message-Id: <Pine.GSO.4.02A.9906161909220.26850-100000@user1.teleport.com>
On Tue, 15 Jun 1999, Bill wrote:
> CGI.pm (at least my versions) defines a method 'sub', which is an
> unfortunate choice of names.
Yes, I remember some discussion about this.
> Now, this generates the 'You need to quote "sub" at...' warning. Is
> there a better way to prevent this waring than using MAIN::sub {}
> since 'sub' is defined in CGI.pm?
Is this what you need?
$ perl -wl
use strict;
use CGI qw/ :html3 !sub /;
*Sub = \&CGI::sub; # Manual import :-P
print Sub(qw/your message here/);
<SUB>your message here</SUB>
> Also, why does changing the last line to
>
> local $SIGx{ALRM} = sub { die "timed out" };
>
> make the warning go away?
I don't know. A bug, maybe? Perhaps worth reporting. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 17 Jun 1999 02:25:51 GMT
From: david.whitmarsh@dial.pipex.com (David Whitmarsh)
Subject: Re: Win32 select()
Message-Id: <37673d30.464744@news.dial.pipex.com>
donath@my-deja.com wrote:
>Hello,
>
>select() doesn't work with ActiveState Perl.
I think I'm right in saying that windows select() works only on
sockets and not on filehandles.
************************************
David Whitmarsh
remove "spamtrap." from email address before replying
Sparkle Computer Co Ltd
Sybase C C++ perl UNIX NT
************************************
------------------------------
Date: Wed, 16 Jun 1999 21:13:31 -0500
From: "Chuck Hirstius" <chirstius@mediaone.net>
Subject: Re: Win32::NetAdmin
Message-Id: <JQY93.8419$s%1.19637297@rmnws01.ce.mediaone.net>
Thanks for the clue David, I posted there(activestate), and got a reply
today pointing me to:
http://www.roth.net/perl/ - Generic perl help for Win32
which led to:
http://www.roth.net/perl/adminmisc/ - Exactly what I needed!
It seems the AdminMisc Module (which borrows from NetAdmin it seems or
perhaps vice-versa) has many of the things I need, including a
"UserCheckPassword()" function which is so simple and clever I wish I had
thought of it! The page docs all of Win32::AdminMisc extremely well, with
many examples included. It's literally a lifesaver, as I need to have the
script written, tested and promoted by next Tuesday, to go chainwide next
Thursday. Looks like now I'll be able to squeeze it in. For anyone else
finding the documentation for Win32::NetAdmin, or Win32::AdminMisc
unreadable (in the case of the compiled HTML docs, for some reason mine were
broken) or uninformative, check those pages out. I hope you find them as
valuable as I did at explaining a very crucial, and usable Win32 Module.
Thanks again David, you were an immense help!
Chuck
David Cassell <cassell@mail.cor.epa.gov> wrote in message
news:37681CD4.FAEBCE77@mail.cor.epa.gov...
> [courtesy cc sent to poster]
>
> Chuck Hirstius wrote:
> >
> > I know WinNT is the lessor OS around here, but maybe someone can offer
some
>
> Not *everyone* around here has the flexibility to avoid all OSes
> that offend their sensibilities. Join the club. And that's "lesser",
> not "lessor" - Bill Gates only *thinks* he owns all of us and rents
> pieces out. :-)
>
> > [snip of problem]
>
> Since no one has posted an answer here, I wanted to let you know
> that you'll probably have better luck getting an answer in one of the
> win32-centric listservs at ActiveState. You can subscribe by
> going to http://www.activestate.com/support/mailing_lists.htm
> and then you can ask there.
>
> > I'm perfectly aware that I'm an idiot as well, and feel free to tell me
so,
> > just include an answer to my question with the insult, so that next time
I
> > will be LESS of an idiot. : )
>
> Having a difficult problem doesn't make you an idiot. It only makes
> you frustrated. If you had posted here with a trivial question
> which was way off-topic for the ng, or which was answered in the
> FAQ, or if you had announced that you couldn't be bothered to read
> the FAQ or the docs but you wanted help anyway, or if you rudely
> asked for someone to write you a custom script.. well then, you
> might have appeared to be an idiot. I don't see any such signs.
>
> HTH,
> David
> --
> David Cassell, OAO cassell@mail.cor.epa.gov
> Senior computing specialist
> mathematical statistician
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 6026
**************************************