[7237] in Perl-Users-Digest
Perl-Users Digest, Issue: 862 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 13 18:07:31 1997
Date: Wed, 13 Aug 97 15:00:23 -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, 13 Aug 1997 Volume: 8 Number: 862
Today's topics:
Re: A Perl compiler for Win95? <jason.holland@dial.pipex.com>
Re: Blanket textual changes <hermann_fass@aia.com>
Re: Create "Pause Page" during big CGI program <christopher.green@nol2316.fh.zh.ubs.com>
dbmopen key and value (help, sort of urgent) <rmcguigan@ramresearch.com>
Re: dbmopen key and value (help, sort of urgent) (Chris Nandor)
Re: File read rate <rootbeer@teleport.com>
global string searches <Mwolak@wesleyan.edu>
Re: Help! - Reformatting Date (Lack Mr G M)
Re: Help! - Reformatting Date (Jot Powers)
Re: how can i find out how much free disk space is ava (Daniel E. Macks)
Re: I can't make my sentence appear when I want <rootbeer@teleport.com>
Re: Nevermind <christopher.green@nol2316.fh.zh.ubs.com>
New User Question on FTP <edbid@cobe.com>
Re: New User Question on FTP <w4vu@unb.ca>
Re: NEWBIE QUESTION <jason.holland@dial.pipex.com>
Re: Odd perl quirk? (brian d foy)
Re: pattern match/replace (Terry Michael Fletcher - PCD ~)
Re: Perl and HTTP (brian d foy)
Re: random numbers (brian d foy)
sorting... <ptrainor@aura.title14STOPSPAM.com>
Re: split perl string <tw36027@glaxowellcome.com>
Re: Stupid MacPerl StandardFile/Choose Question (Matthew D. Healy)
Re: Time problem. <merlyn@stonehenge.com>
Re: Using Parameter (variables) files <lilly@fedex.com>
Re: Walking the tree <mark@tstonramp.com>
Re: WIN32Perl vs. Perl ( ~= and =~) <rootbeer@teleport.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 13 Aug 1997 20:08:39 GMT
From: "Jason" <jason.holland@dial.pipex.com>
Subject: Re: A Perl compiler for Win95?
Message-Id: <01bca824$7f982e20$e5fb82c1@dial.pipex.com.pipex.com>
I don't know about a compiler, but I recently got hold of Perl for Win32
by looking up the Perl programming language section on www.yahoo.com.
Look carefully and you should be able to find it quite quickly
Jason.H
Thomas Larsson <thomas.larsson@vpress.se> wrote in article
<33f0bce5.5969983@news.multi.se>...
> Can anyone supply me with an adress to a site where I can download a
> Perl compilator?
>
> /Thomas Larsson
>
------------------------------
Date: Wed, 13 Aug 1997 22:24:57 -0400
From: Web Administrator <hermann_fass@aia.com>
Subject: Re: Blanket textual changes
Message-Id: <33F26AA9.41C6@aia.com>
What about simply reading the input into a variable $input and just
s#(<applet>).*?(</applet>)#$1$input$2#;
Perhaps not very elegant ... Perl is not for analysis but for doing jobs
:-)
> Any elegant ideas on how I can
> replace everything between <applet> and </applet> with the contents of
> another text file? Other ideas about document managment welcome also.
> Thanks for your time.
>
> -Steve
------------------------------
Date: Wed, 13 Aug 1997 20:26:06 +0200
From: Christopher Green <christopher.green@nol2316.fh.zh.ubs.com>
To: dadamson@newtonline.com
Subject: Re: Create "Pause Page" during big CGI program
Message-Id: <33F1FC3E.A89E9F6E@nol2316.fh.zh.ubs.com>
dadamson@newtonline.com wrote:
> Hello-
>
> I was looking for recommendations for how I would throw up a page
> that said "please wait while running script/program..."
> while the cgi executed a long program followed by a page that
> confirms completion - like "Program complete"?
>
> THanks
> Dag
>
> PLease Post and Email
>
> -------------------==== Posted via Deja News
> ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
Try the following:
Set Autoflush in Perl ($&=1) and send a non-parsed HTML header (this
means that the output from the CGI is shown in real-time).
Send a <body> with " Please wait " message. Perhaps you ought to send a
space every now and then so the connection doesn't time out. When the
CGI is finished, you can do one of the following:
- ammend the "finished, outcome OK/notOK" message to what is already on
the page
- send a <meta tag> with a redirection to a "standard response" or
dynamically built response page
- send a Javascript which sets the "window.location" property (to a
second page)
- send a JavaScript which deletes the document, then send the response
text (with </body> etc.) (This would be my choice, I believe)
- send a JavaScript with a simple "Alert: CGI terminated
benevolently"-box
- (et cetera ad absurdum)
I can't think of a way which does both
a) remain within HTML (no JavaScript) and
b) display two distinct, but dynamically built pages without using
either temporary or "standard response" files,
because basically, a CGI is no more than a HTML page which takes long to
load, as far as the browser in concerned.
Hope this points you in a direction which will lead to success
- chris
------------------------------
Date: 13 Aug 1997 18:23:30 GMT
From: "Ryan" <rmcguigan@ramresearch.com>
Subject: dbmopen key and value (help, sort of urgent)
Message-Id: <01bca817$2a0b5070$6e6fa1cd@www>
I'm designing a program to keep track of banner advertising for our
company, I just have a few simple questions.
Right now I'm using dbmopen to store data, is there anyway to have
something more than $key and $value, such as multiple records? If not
possible, I would have to emulate it somehow, any suggestions.
I'm running perl on winnt, but, I don't want to use ODBC because I want to
keep it portable.
------------------------------
Date: Wed, 13 Aug 1997 15:04:48 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: dbmopen key and value (help, sort of urgent)
Message-Id: <pudge-ya02408000R1308971504480001@news.idt.net>
In article <01bca817$2a0b5070$6e6fa1cd@www>, "Ryan"
<rmcguigan@ramresearch.com> wrote:
# I'm designing a program to keep track of banner advertising for our
# company, I just have a few simple questions.
#
# Right now I'm using dbmopen to store data, is there anyway to have
# something more than $key and $value, such as multiple records? If not
# possible, I would have to emulate it somehow, any suggestions.
#
# I'm running perl on winnt, but, I don't want to use ODBC because I want to
# keep it portable.
Either delimit the value with a character not found in value (i.e., $x{$y}
= 'field1|field2|field3', or try using MLDBM, on CPAN, which allows for
storing multi-dimensinal arrays in DBMs.
--
Chris Nandor pudge@pobox.com http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10 1FF7 7F13 8180 B6B6'])
------------------------------
Date: Wed, 13 Aug 1997 14:26:07 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Krishnan Jayakrishnan <saljxk@dix.agl.uh.edu>
Subject: Re: File read rate
Message-Id: <Pine.GSO.3.96.970813142443.18496I-100000@julie.teleport.com>
On 13 Aug 1997, Krishnan Jayakrishnan wrote:
> was wondering if it really matters to search a file line by
> line instead of globbing the entire contents
Yes, especially if the match is likely to be found near the beginning of
the file. Of course, if the search text isn't in the file, you still have
to read the whole file, so it doesn't make much difference in that case.
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 13 Aug 1997 08:26:03 -0400
From: Matt Wolak <Mwolak@wesleyan.edu>
Subject: global string searches
Message-Id: <33F1A7DA.80A96115@wesleyan.edu>
I am currently writing a program that extracts info from pdb (a chemical
format) files. Is it 'legal' to search in the same string you are doing
a global search on ie:
while($str =~ /whatever(.{3})/g){
$temp = $1;
if($str =~ /somethingelse $temp/){ #Not really what I'm tring
to do, just an example
print("yes")
}
}
or does this mess up the global searches pointer?
Thanks:
Matt
------------------------------
Date: Wed, 13 Aug 1997 19:04:55 BST
From: gml4410@ggr.co.uk (Lack Mr G M)
Subject: Re: Help! - Reformatting Date
Message-Id: <1997Aug13.190455@ukwit01>
In article <01bca80e$8695bd20$1335bca1@pni3188.phillypapers.com>, "Rick Schwein" <rschwein@philly.infi.net> writes:
|> Albert W. Dorrington <awdorrin@ictest.delcoelect.com> wrote in article
|> <5sanl7$ies@ws051eng.ictest.delcoelect.com>...
|> >
|> > One way to do this is to use the localtime function.
|> >
|> > ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
|> >
|> > For a date format like '8/4/1997' you would then do:
|> >
|> > $mon =+ 1; # Needed because $mon is 0-11
|> > $year =+ 1900; # needed because $year has 1900 subtracted from it
|> > $datestamp = "$mon/$mday/$year";
|> >
|> I don't recall seeing anything about Year 2000 issues in the FAQ , but
|> could easily have overlooked it. If not, what happens in three years?
|> This fragment looks like Year 2000 will give a problem.
The simplest way to check this is to try it. Just give localtiem
some value that corresponds to ~3 years in the future.
You will then find whether it works on your system (works on mine).
Mind you, you will also find that the code snippet above is wrong, in
that it has '=+' where it should have '+='.
--
----------- Gordon Lack ----------------- gml4410@ggr.co.uk ------------
The contents of this message *may* reflect my personal opinion. They are
*not* intended to reflect those of my employer, or anyone else.
------------------------------
Date: 13 Aug 1997 18:27:55 GMT
From: news@bofh.com (Jot Powers)
Subject: Re: Help! - Reformatting Date
Message-Id: <5ssubb$sv4$1@gazette.corp.medtronic.com>
In article <01bca80e$8695bd20$1335bca1@pni3188.phillypapers.com>,
Rick Schwein wrote:
>Albert W. Dorrington <awdorrin@ictest.delcoelect.com> wrote in article
><5sanl7$ies@ws051eng.ictest.delcoelect.com>...
>>
>> One way to do this is to use the localtime function.
>>
>> ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
>>
>> For a date format like '8/4/1997' you would then do:
>>
>> $mon =+ 1; # Needed because $mon is 0-11
>> $year =+ 1900; # needed because $year has 1900 subtracted from it
>> $datestamp = "$mon/$mday/$year";
>>
>I don't recall seeing anything about Year 2000 issues in the FAQ , but
>could easily have overlooked it. If not, what happens in three years?
>This fragment looks like Year 2000 will give a problem.
perldoc perlfaq4
Does Perl have a year 2000 problem?
Not unless you use Perl to create one. The date and time
functions supplied with perl (gmtime and localtime) supply
adequate information to determine the year well beyond 2000
(2038 is when trouble strikes). The year returned by these
functions when used in an array context is the year minus
1900. For years between 1910 and 1999 this happens to be a
2-digit decimal number. To avoid the year 2000 problem
simply do not treat the year as a 2-digit number. It isn't.
When gmtime() and localtime() are used in a scalar context
they return a timestamp string that contains a fully-
expanded year. For example, $timestamp = gmtime(1005613200)
sets $timestamp to "Tue Nov 13 01:00:00 2001". There's no
year 2000 problem here.
That code will break in 2038 with the rest of Unix though. :)
-Jot
--
Jot Powers news@bofh.com
Unix System Administrator
"Sometimes you just have to grab the bull by the tail and face the situation."
------------------------------
Date: 13 Aug 1997 21:22:37 GMT
From: dmacks@sas.upenn.edu (Daniel E. Macks)
Subject: Re: how can i find out how much free disk space is available in perl
Message-Id: <5st8it$sqd$1@netnews.upenn.edu>
weiner (kweiner@bloomberg.com) said:
: thanks!!!!!
You're welcome. But don't thank us until you get an answer to a
question that you almost asked with enough detail for an answer. Most
importantly: what OS? On Unix systems, you could parse the results of
`df`. Otherwise, there may or may not be a some system call and/or
routine in the OS-specific CPAN modules. I don't see a perlish wrapper
for the actual system call on CPAN, but if you're feeling adventurous,
you could write (and contribute:) blahblah::DF based on statvfs().
dan
--
Daniel Macks
dmacks@a.chem.upenn.edu
dmacks@netspace.org
http://www.netspace.org/~dmacks
------------------------------
Date: Wed, 13 Aug 1997 14:22:47 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: C E Havlioglu <havliogc@cs.man.ac.uk>
Subject: Re: I can't make my sentence appear when I want
Message-Id: <Pine.GSO.3.96.970813142215.18496H-100000@julie.teleport.com>
On 13 Aug 1997, C E Havlioglu wrote:
> However, when I run it, instead of doing this it waits until the
> socket stuff is finished and then writes
> Reading URL...done
> all at once.
Sounds like buffering. Check out $| in the perlvar(1) manpage. Hope this
helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 13 Aug 1997 20:33:39 +0200
From: Christopher Green <christopher.green@nol2316.fh.zh.ubs.com>
To: scott mcclurg <smcclurg@inet.net>
Subject: Re: Nevermind
Message-Id: <33F1FE03.1D521FBB@nol2316.fh.zh.ubs.com>
scott mcclurg wrote:
> Found the problem.
> Thanks anyway
Good for you. Are you willing to enlighten the rest of us?
(or was it not Perl, but an the kind of SNAFU I always think only
happens to me? :)
- chris
------------------------------
Date: Wed, 13 Aug 1997 13:20:55 -0600
From: Edward Bidinotto <edbid@cobe.com>
Subject: New User Question on FTP
Message-Id: <33F20917.2738@cobe.com>
I am new to perl and trying to do the following:
If (some condition)
# Ftp over to a server
# Login as a user
# Pass in a passwd
# Put a file via FTP
exit
I can't find any examples of this in my learning perl in 21 days book
so I guess I'm screwed until someone answers.
Thanks in advance...
Ed
edbid @ cobe.com
------------------------------
Date: Wed, 13 Aug 1997 16:14:47 -0400
From: David Tweedie <w4vu@unb.ca>
Subject: Re: New User Question on FTP
Message-Id: <33F215B7.6EC6@unb.ca>
Ed,
There is a module called Net::FTP whic you can download off the CPAN
site. You will have to have the IO and Data Modules installed as well in
order to run this.
Dave
Edward Bidinotto wrote:
>
> I am new to perl and trying to do the following:
>
> If (some condition)
>
> # Ftp over to a server
> # Login as a user
> # Pass in a passwd
> # Put a file via FTP
>
> exit
>
> I can't find any examples of this in my learning perl in 21 days book
> so I guess I'm screwed until someone answers.
>
> Thanks in advance...
> Ed
>
> edbid @ cobe.com
------------------------------
Date: 13 Aug 1997 20:06:10 GMT
From: "Jason" <jason.holland@dial.pipex.com>
Subject: Re: NEWBIE QUESTION
Message-Id: <01bca824$267c4a60$e5fb82c1@dial.pipex.com.pipex.com>
Hi, I too am new to Perl and stumbled across this one quite early in my
experience.
I cannot remember why it returns those numbers, but I assume that you want
a string to be returned?
Try:
print '$blunk=',"$blunk\n";
This ought to force an evalutation in string context.
Thanks accepted in advance.
Jason.H
Xu Chu <xuchu@iscs.nus.edu.sg> wrote in article
<5spm8k$9gg@nuscc.nus.sg>...
> hello, i am new in perl. can someone help me out with this question?
>
> $name{12345} = 'John Doe';
> $name{24680} = 'Jane Smith';
> $blunk = %name;
> print '$blunk=',$blunk,"\n";
>
> i run it and gets "$blunk=2/8". can u tell me why it is the result?
>
> --
> wings
> ------
> You cannot learn anything unless you almost know it already.
>
>
------------------------------
Date: Wed, 13 Aug 1997 16:03:12 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Odd perl quirk?
Message-Id: <comdog-ya02408000R1308971603120001@netnews.worldnet.att.net>
In article <33F1EFCA.4B35@inet.net>, scott mcclurg <smcclurg@inet.net> wrote:
> The following bit of code works for all letters except the letter j:
>
> #!/usr/bin/perl -w
>
> for($dir = 'a';$dir ne 'aa';$dir++) {
> print ("Directory $dir follows...\n");
> print `find /export/home/www/$dir*/public_html -name index.html`;
> }
>
> This is part of a program we are using to list the pages of our users,
> separated by the first letter of their usernames. If you replace $dir
> with the letter j, it still does not work, but it works fin from a UNIX
> prompt.
you say that it doesn't work but works from the UNIX prompt. hmmm...
how about if you rethink the mechanics a bit and avoid the call to
the shell which obviates that problem of not using the absolute
path to `find` so that other processes with different environments
know where to find (ahem...) it:
#!/usr/bin/perl
use subs qw(my_error_routine);
# get a list of users
opendir DIR, '/export/home/www' or my_error_routine;
@users = readdir DIR;
closedir DIR;
foreach $user ( @users )
{
# only continue if the file exists (requiring -d $user ! )
next unless -e "/export/home/www/$user/public_html/index.html";
print "whatever floats your boat";
}
sub my_error_routine { #yadda yadda yadda }
__END__
--
brian d foy <URL:http://computerdog.com>
------------------------------
Date: 13 Aug 1997 17:53:35 GMT
From: tfletche@pcocd2.intel.com (Terry Michael Fletcher - PCD ~)
Subject: Re: pattern match/replace
Message-Id: <5sssav$1qs$1@news.fm.intel.com>
Craig Berry (cberry@cinenet.net) so eloquently and verbosely pontificated:
> I've only lightly tested this, and it leaves excess whitespace in the
> string, but how about:
>
> $string = '<blah blah KEYWORD blah KEYWORD blah blah> KEYWORD <blah KEYWORD>';
>
> print "Before: $string\n";
>
> 1 while $string =~ s/(<[^>]*?)KEYWORD([^<]*?>)/$1$2/g;
>
> print "After: $string\n";
>
> Output is:
>
> Before: <blah blah KEYWORD blah KEYWORD blah blah> KEYWORD <blah KEYWORD>
> After: <blah blah blah blah blah> KEYWORD <blah >
cool. i like it. its almost exactly what i started thinking when i saw
the original post. i think to address the whitespace issue, you should
use (although it makes the line long):
s/(<[^>]*?)(?:\sKEYWORD|KEYWORD\s|KEYWORD){[^<]*?>)/$1$2/g;
the non greedy *? match didnt matter in your example, but now it lets the
whitespace get slurped by the non-backreferenced first-match-wins paren
group.
--
"Give me ambiguity or give me something else."
______ ______ _ _
(_) | (_) | | | | |
| _ ,_ ,_ _|_ | | _ _|_ __ | | _ ,_
_ ||/ / | / | | | / | ||/ |/ | / |/ \ |/ / |
(_/ |__/ |_/ |_/ \_/|/ (_/ |__/|__/|_/\___/| |_/|__/ |_/
*+*+*+*+*+*+*+*+*+*+*+* /| *+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*
\| tfletche@pcocd2.intel.com
*+*+*+*+*+ Views expressed...not INTeL's...yadda yadda yadda.... *+*+*+*+*+*
------------------------------
Date: Wed, 13 Aug 1997 15:49:39 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Perl and HTTP
Message-Id: <comdog-ya02408000R1308971549390001@netnews.worldnet.att.net>
In article <871490111.16183@dejanews.com>, rob@persimmon.com wrote:
> Does anyone have a Perl script that initiates an HTTP connection
> and performs a POST action, or even a GET? I'm new to sockets
> and am just looking for some examples.
sure. you can look at the LWP family of modules source code, for
instance.
as for opening a socket, you won't need to stray very far from the
example given in the Camel book. the only trick is to send the
correct HTTP message, but the HTTP specification [1] tells you all
about that.
[1]
RFC 2068 - Hypertext Transfer Protocol -- HTTP/1.1
<URL:http://www.ics.uci.edu/pub/ietf/http/rfc2068.txt> or
<URL:http://www.cis.ohio-state.edu/htbin/rfc/rfc2068.html>
--
brian d foy <URL:http://computerdog.com>
------------------------------
Date: Wed, 13 Aug 1997 16:13:59 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: random numbers
Message-Id: <comdog-ya02408000R1308971613590001@netnews.worldnet.att.net>
In article <5ssmo1$lm4@chile.earthlink.net>, david1@earthlink.net wrote:
> I am writing a test generation script in perl. The questions that are given
> are random.
>
> I am familiar with the rand function but I need to generate 15 random numbers
> from a range of 1 to 30 that are unique from each other. The rand function
> does not guarantee this.
not the end all of routines, but just an one of the many ways to do it:
#!/usr/bin/perl -w
use strict;
# initialization stuff
my $count = 0;
my %hash;
srand(); # get more fancy if you like
# while we still need numbers. we'll store new numbers as the
# keys to a hash so we can quickly check for existence with, well,
# exists.
while( $count < 15 )
{
# generate a new pseudo-random number
my $new_number = int( rand(30) ) + 1;
# if we already have the number, start again
next if exists $hash{$new_number};
# store the new number so we can check for it next time
$hash{$new_number} = 1;
# count our numbers so we know how many we have
$count++;
}
foreach ( sort {$a <=> $b} keys %hash )
{ print "$_ ";}
print "\n";
__END__
--
brian d foy <URL:http://computerdog.com>
------------------------------
Date: Wed, 13 Aug 1997 15:04:55 -0400
From: Pat Trainor <ptrainor@aura.title14STOPSPAM.com>
Subject: sorting...
Message-Id: <Pine.LNX.3.95.970813150221.21194E-100000@aura>
Thanks to everyone who replied with the count++ problem, I learned a lot fast!
Now for another lob..
if I output:
while (($key, $value) = each(%MAIN_CHOICES)) {
print "$key has a value of $value\n <br>";
}
The output is unsorted.
What is the best way to sort the output by either key or value? Do I need to
port the output through sort and build another array? Sorry for the newbie question!
pat
:)
###
### to reply, remove STOPSPAM from the email address ***
###
ptrainor@aura.title14.com
http://www.title14.com/resume
"While it's true winning isn't everything-LOSING IS NOTHING!" -Ed Bighead
------------------------------
Date: Wed, 13 Aug 1997 14:01:51 -0400
From: Thad Welch <tw36027@glaxowellcome.com>
To: Danny LaPrade <dannyl@computize.com>
Subject: Re: split perl string
Message-Id: <33F1F68F.AE5ACAD0@glaxowellcome.com>
Here's my solution:
$s = 'here1here2here3here4here5here6here7';
for ($x=0; $x<length($s) || (length($s) == 0 && $x==0); $x+=5) {
push( @s, substr($s, $x, 5 ) );
}
$c = @s;
print "\n count=$c '@s' \n";
If speed is super important, you could port this could to C (almost
verbatim).
Danny LaPrade wrote:
> How do I split at string like
>
> "here1here2here3here4here5here6here7"
>
> every 5th character?
>
> And all are char (s).
>
> I want to be able to take this string
> and split it every five chars and the string
> can be anywhere from 0 to 100 chars long.
> Also want to be able to compare each to a string.
>
> Can anyone help ?
> Need something efficient.
> --
> --------------------------------------------------------------
> -- Danny LaPrade
> -- Advertising - Web Development
> -- 1030 Wirt Road #400
> -- Houston, Texas 77055-6849
> -- 713.957.0057 ext 211
> -- 713.613.4812 Fax
> --
> -- http://www.computize.com/
> --------------------------------------------------------------
>
> "Hold on to your dreams while pulling
> through the present. "
------------------------------
Date: Wed, 13 Aug 1997 15:25:30 -0500
From: Matthew.Healy@yale.edu (Matthew D. Healy)
Subject: Re: Stupid MacPerl StandardFile/Choose Question
Message-Id: <Matthew.Healy-1308971525300001@pudding.med.yale.edu>
In article <Hans.DeBano-ya02408000R0608972006370001@news.asu.edu>,
Hans.DeBano@asu.edu (Hans DeBano) wrote:
Have you tried setting the PATH $ENV variable?
--------
Matthew.Healy@yale.edu http://ycmi.med.yale.edu/~healy/
As of 7 Aug 1997, only 876 days until Y2K....
Any person with a phone line can become a town crier with a voice
that resonates farther than it could from any soapbox.
--The US Supreme Court, overturning the Communications Decency Act
------------------------------
Date: 13 Aug 1997 14:25:51 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Time problem.
Message-Id: <8cafilvkps.fsf@gadget.cscaper.com>
>>>>> "Tom" == Tom Phoenix <rootbeer@teleport.com> writes:
Tom> On Wed, 13 Aug 1997, Paul Jorgensen wrote:
>> Yeah. Same thing here. I reasoned that Perl (or my OS) counts months
>> beginning at 0 insted of 1. What is the ruling on this?
Tom> It's the OS which does it. Since it's documented, it's not a bug. :-)
Tom> Hope this helps!
Actually, the Unix OS doesn't even know what the month is. :-) That's
all done in libc code, in user-space. The Kernel/system-call
interface is all based on the Unix epoch seconds.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 383 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Wed, 13 Aug 1997 13:14:58 -0500
From: Dave Lilly <lilly@fedex.com>
Subject: Re: Using Parameter (variables) files
Message-Id: <33F1F9A2.2781@fedex.com>
Trent Tucker wrote:
>
> Howdy-
>
> I'm a newbie at PERL, and though I've looked through the Llama Book
> and FAQs for a solution to my simple problem, I haven't been able to
> come up with the answer.
>
> B) reading (importing) previously created key/value pairs into an
> associative array from a "variables" text file.
>
> Basically, what I'm trying to do is use one script to collect some
> data and store it in a text file, and then use another script to
> process the data. The storing is no problem. What I don't know
> how to do it slurp it back into the second script and reestablish
> the variables. The additional wrinkle that I have is that some
> values may be more than one line long.
Okay, seeing as how you can get them into a file already...
open (FILE, "/path/to/my/file") or die "Couldn't open file";
while (<FILE>) {
($key, $value) = split (/x/);
$$key = $value;
}
close FILE;
(the "x" in the split statement is your delimeter)
Then you can reference your variables the same way you did in the first
script.
Hope this helps!
-dave
------------------------------
Date: Tue, 12 Aug 1997 22:58:07 -0700
From: "Mark J. Schaal" <mark@tstonramp.com>
Subject: Re: Walking the tree
Message-Id: <33F14CEF.47E4@tstonramp.com>
Jeff Masiello wrote:
>
> We have a Unix server which needs massive cleaning. I just learned perl
> but I would like to write a program which walks the directory structure
> and catalogs files by directory giving their locations. it would be
> easy if the foreach loops read directories first but they don't. I'm
> using the -d test but how do I get it so it lists all the files first
> and then moves on to the next subdir?
I know it's not a perl solution (God forbid :-) but does 'ls -R' do
what you want?
mark
--
Mark J. Schaal TST On Ramp Sysadmin mark@tstonramp.com
------------------------------
Date: Wed, 13 Aug 1997 14:21:19 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: mbosley <mbosley@games-online.com>
Subject: Re: WIN32Perl vs. Perl ( ~= and =~)
Message-Id: <Pine.GSO.3.96.970813141636.18496G-100000@julie.teleport.com>
On Wed, 13 Aug 1997, mbosley wrote:
> On normal perl (5.003) I use the statement '$var ~= s/\W//g;'
That doesn't work for me, with any version of Perl.
> but in WIN32 it fails. It then works if I use '$var =~ s/\W//g;'
> reversing the ~= with =~.
The pattern binding operator is (and has always been) =~ . If you find any
documentation which suggests using ~= as the pattern binding operator,
please file a bug report so we can fix it. Thanks!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 862
*************************************