[8260] in Perl-Users-Digest
Perl-Users Digest, Issue: 1876 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 12 15:07:29 1998
Date: Thu, 12 Feb 98 12:00:30 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 12 Feb 1998 Volume: 8 Number: 1876
Today's topics:
Re: ? Regular Expressions ? <a@b.c.d>
assigning variable names (Jfontaine2)
Re: Can you flush a print statement to the browser imme (Jeffrey R. Drumm)
Re: Clearing all variables <tchrist@mox.perl.com>
Re: Clearing all variables <elaine@lainer.com>
Re: Clearing all variables <sgordon@athena.lbl.gov>
Re: Code Example Needed <sfarrell+usenet@farrell.org>
Re: combine lines(swap 2)for novice user <NerveGas@see_signature.com>
Re: combine lines(swap 2)for novice user <ajohnson@gpu.srv.ualberta.ca>
Re: Date validation <SNIPhsommer@micro.ti.comSNIP>
Re: Date validation <SNIPhsommer@micro.ti.comSNIP>
Re: Date validation (Francois Trousset)
Re: Date validation <dboorstein@shopcfn.com>
does perl store the shattered remains of an attempted m (Kevin B Cohen)
Re: FAQless Forays (was: Code Example Needed) (sean broderick)
Re: FAQless Forays (was: Code Example Needed) (I R A Aggie)
Help installing Text::NWrap jase@cadence.com
Re: How do I export environment variables? <zenin@best.com>
Re: How the Hell do I...? (I R A Aggie)
Re: HUMOR: Userspeak vs Hackerspeak <NerveGas@see_signature.com>
Re: LWP.pm Question <sfarrell+usenet@farrell.org>
Re: Newbie needs HELP (Andrew M. Langmead)
Re: on reading FAQs and gurus answering questions (Marc Haber)
Re: on reading FAQs and gurus answering questions (Steve Linberg)
Re: Perl Wizard Quiz chris+usenet@netmonger.net
Re: RFC about "Matt's Script Archive" <camerond@mail.uca.edu>
Sample, simple script which uses threads ? (Lars Marowsky-Bree)
Re: Seriously Off Topic, but a Common Complaint/Problem (I R A Aggie)
So what about last summer's RFD? Let's go moderated. (Steve Linberg)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 12 Feb 1998 14:45:54 -0500
From: Myles Barrett Williams <a@b.c.d>
Subject: Re: ? Regular Expressions ?
Message-Id: <lc67mksj2l.fsf@duncan.cs.utk.edu>
phenix@interpath.com (John Moreno) writes:
> If you'd read all of the messages in the newsgroup that were on your
> server before posting, you would have almost surely come across the fact
> that the manuals are distributed with the languague. If you've got one
> on your machine you should have the other. RTFM.
I downloaded and installed the djgpp build of Perl. I don't have the
manuals on my machine. Go figure.
Since I rarely need to refer to the manuals, I get them from
www.perl.com.
mwilliam@ | "When you see me again, it won't be me."
cs.utk.edu | I successfully filter out ALL junk E-mail.
------------------------------
Date: 12 Feb 1998 19:15:41 GMT
From: jfontaine2@aol.com (Jfontaine2)
Subject: assigning variable names
Message-Id: <19980212191500.OAA04067@ladder02.news.aol.com>
I am looking to write a script that will take a given paramater, assign it a
name, and then concatonate it with other parameters to assemble a file name.
In the long run, the program will then take the filename and fetch it from the
server. I am having trouble assigning the parameters names though. Could
anyone provide me with some insight?? I can be reached at jfontaine2@aol.com
------------------------------
Date: Thu, 12 Feb 1998 18:50:15 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: Can you flush a print statement to the browser immediately?
Message-Id: <34e33bf2.1815340832@news.mmc.org>
On Thu, 12 Feb 1998 11:27:16 -0600, "Rick Ryan" <rickryan@datrixnet.com> wrote:
>I've got a perl script where I'm using back ticks to run a system command to
>retrieve information from a database. I've also got some PRINT statements up
Ummm, Perl doesn't have a PRINT statement. Perhaps you're thinking of BASIC?
Perl does have a print function, though.
>above the system call but they don't show up until the entire program has
>been run. Is there any way to "flush" the print commands to the screen
>immediately so that the user can see that something's going on?
If you had taken the trivial amount of time needed to do a cursory examination
of the Perl documentation, perhaps searching for the word "flush", you may have
gotten the answer to your question much more quickly.
Here's a hint: what you're looking for is in perlvar. And if it doesn't
completely solve your problem, the solution isn't here. Another hint: read your
web server documentation. The key phrase is "non-parsed headers".
And, yes, I'm being a jerk. To find out why, see the thread "FAQless Forays
(was: Code Example Needed)" in this news group. Wear your nice asbestos suit.
--
Jeffrey R. Drumm, Systems Integration Specialist
Maine Medical Center - Medical Information Systems Group
drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me
------------------------------
Date: 12 Feb 1998 17:54:23 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Clearing all variables
Message-Id: <6bvd0f$ira$4@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, "Lainer" <elaine@lainer.com> writes:
:Is there a function I can use to clear all variables before the next line of
:a program is executed?
You might look into the reset function as documented in the perlfunc
manpage. But in your situation, I might well consider simply calling
the other program as a separate executable, not wrapping it up in the
same process.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
if (shm == (char *)-1) /* I hate System V IPC, I really do */
--Larry Wall, from doio.c in the v5.0 perl distribution
------------------------------
Date: Thu, 12 Feb 1998 13:09:22 -0500
From: "Lainer" <elaine@lainer.com>
Subject: Re: Clearing all variables
Message-Id: <34e33aa2.0@myth.vianet.on.ca>
I am calling it as a separate executable using "require" at the end of the
loop. The program has about 1,000 variables and it would take forever to
intialize each one of them, I was looking for a way around the individual
initialization.
Tom Christiansen wrote in message <6bvd0f$ira$4@csnews.cs.colorado.edu>...
> [courtesy cc of this posting sent to cited author via email]
>
>You might look into the reset function as documented in the perlfunc
>manpage. But in your situation, I might well consider simply calling
>the other program as a separate executable, not wrapping it up in the
>same process.
>
------------------------------
Date: Thu, 12 Feb 1998 10:56:01 -0800
From: Shawn Gordon <sgordon@athena.lbl.gov>
To: Lainer <elaine@lainer.com>
Subject: Re: Clearing all variables
Message-Id: <34E345C1.811545A0@athena.lbl.gov>
Lainer wrote:
>
> Is there a function I can use to clear all variables before the next line of
> a program is executed?
>
> I have an access log analysis program which I got as freeware. The person
> that wrote it designed it to only analyze one log file at a time. What I
> have done is created a new parent program which reads from a data file
> containing a list of client log files I want analyzed. I am using a foreach
> statement to read each line of this data file, get the required location of
> certain files needed, then it calls the main program and executes it. The
> problem I am facing is that all the data from the first log file analyzed is
> being carried forward to the next which I obviously don't want.
>
> Any and all help would be appreciated. Please respond via email as this is
> rather urgent for a client of mine.
>
> Thanks in advance.
>
> Elaine Parker
> elaine@lainer.com
I can think of two or three possible solutions. It is difficult
to give you a defn. response, because you don't show
any code, as a result, I do not know really what kind of a problem
you are dealing with.
That being said, here are some possible approaches:
1) Quick and dirty: have your 'parent' program call the log analysis
program
as an entirely different process. ie:
for () {
$result = `loganalysis.pl`;
}
# you can use system() or open() to do this also.
# all variables will be reset upon re-execution.
2) Less Quick: Find the offending variables and make sure you reset it
before each
new cycle. perl debugger will help here
3) Long and elegant: use the pragma 'use strict' and make sure that all
variables
are declared with 'my' (lexical scoping) and declared within the scope
that you
want them defined. ie:
for () {
my @blah;
my $result = loganalysis();
push(@blah,$result);
}
# @blah, and $result are reset during each cycle.
Good luck,
shawn
------------------------------
Date: Thu, 12 Feb 1998 19:17:59 GMT
From: stephen farrell <sfarrell+usenet@farrell.org>
Subject: Re: Code Example Needed
Message-Id: <87wwf0ws2g.fsf@phaedrus.uchicago.edu>
mystra@torilmud.com (Eileen Kortright) writes:
> I'm attempting to create a wholly new calendar for a fantasy setting
> and having the date correlate with the current date in real life. This
> means creating entirely new months and days and referencing them to
> the current date (Julian date, easier to use). I want this to be
> portable to other sites, without the use of the perl date libs, so I
^^^^^^^^^^^^^^^
But don't you think they might serve as a good example?
--sf
------------------------------
Date: Thu, 12 Feb 1998 09:06:48 -0700
From: NerveGas <NerveGas@see_signature.com>
Subject: Re: combine lines(swap 2)for novice user
Message-Id: <34E31E18.1729@see_signature.com>
> Sorry for asking the trivial question as i'm a newbir in perl
> I have a file with 3 lines, say:
> this is line 1
> this is line 2
> this is line 3
>
> My objective is to turn them into one single line with first and
> second swapped, i.e. the result should be like:
>
> this is line 2 this is line 1 this is line 3
>
> What simple perl script could do this ?
This is very simple and unelegant, but fits the bill:
$my_new_line = "$line2 $line1 $line3";
If there are other requirements (i.e., which ones to swap depends on
the data), other methods would be necessary.
steve
--
------------------------------
Date: Thu, 12 Feb 1998 12:56:19 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: combine lines(swap 2)for novice user
Message-Id: <34E345D3.7AEF3425@gpu.srv.ualberta.ca>
Mike Stok wrote:
!
! In article <6bv6fd$p2c$1@anais.eerie.fr>,
! Francois Trousset <trs@eerie.fr> wrote:
! > Hi,
! >
! > Sorry, I have not mentioned the SWAP needed between line 1 and
! > 2, just add the following lines just after the `close FD;' line:
! >
! > $tmp = $text[0];
! > $text[0] = $text[1];
! > $text[1] = $tmp;
!
! You can say
!
! @text[0, 1] = @text[1,0];
!
! to avoid a temporary variable...
indeed, that could be applied to the original question as:
#!/usr/bin/perl -w
chomp(@data[1,0,2]=<DATA>);
print "@data\n";
__DATA__
line 1
line 2
line 3
regards
andrew
------------------------------
Date: Thu, 12 Feb 1998 12:33:22 -0600
From: Holly Sommer <SNIPhsommer@micro.ti.comSNIP>
Subject: Re: Date validation
Message-Id: <34E34072.72CFB62C@micro.ti.comSNIP>
Stan Horwitz wrote:
: Any suggestions you may have will be appreciated.
Try:
($mm, $dd, $yyyy) = split ( /\\/, $start_date);
$mm = $mm +0; # these effectively strip off
$dd = $dd + 0; # any leading zeros
if ($mm > 12 || $mm < 1 ) {
$date_okay = "N";
print "\n Invalid date ".$start_date;
}
-Holly
------------------------------
Date: Thu, 12 Feb 1998 12:34:41 -0600
From: Holly Sommer <SNIPhsommer@micro.ti.comSNIP>
Subject: Re: Date validation
Message-Id: <34E340C1.8AF9A0F5@micro.ti.comSNIP>
Holly Sommer wrote:
> ($mm, $dd, $yyyy) = split ( /\\/, $start_date);
Of course, I meant ($mm, $dd, $yyy) = split ( /\//, $start_date);
-Holly, triggerfinger
------------------------------
Date: 12 Feb 1998 18:52:07 GMT
From: trs@eerie.fr (Francois Trousset)
To: stan@thunder.temple.edu (Stan Horwitz)
Subject: Re: Date validation
Message-Id: <6bvgcn$rli$1@anais.eerie.fr>
In article <6bv9j2$s1s$1@cronkite.ocis.temple.edu>,
stan@thunder.temple.edu (Stan Horwitz) writes:
> if (substr($start_date, 0, 2) ne "01 .. 12")
Hi,
You compare the two 1st caraters of the date with the string
"01 .. 12", and not "01" "02" ...... "12" :-)
> But this just doesn't seem to work. What am I doing wrong?
In fact it works very well, the condition is always realized.
As perl is able to convert automatically strings to numbers,
you may get what you want by testing if the result of
substr($start_date, 0, 2) is < 1 or is > 12, and that they are
both numbers.
Francois Trousset
------------------------------
Date: Thu, 12 Feb 1998 14:11:42 -0500
From: Dan Boorstein <dboorstein@shopcfn.com>
Subject: Re: Date validation
Message-Id: <34E3496E.DB5129D8@shopcfn.com>
Stan Horwitz wrote:
>
>
> Here's what I came up with:
>
> if (substr($start_date, 0, 2) ne "01 .. 12")
> {
> $date_okay = "N"; print "\n Invalid date ".$start_date;
> }
"01 .. 12" is a string, so the attempt at using the range operator is
missed by perl. wrapping it parentheses like (01 .. 12) will get you
a list, but unfortunately that will still leave your problem unsolved.
you could create that list and then search it for a "hit", but
this has its own problems. your list will be numeric and will not
have leading zeros, so using string comparisons would be unwise.
if you know that your month is going to have padded zeros, then
a simple regex like:
if (substr($start_date, 0, 2) !~ m/0[1-9]|1[012]/)
{
$date_okay = "N"; print "\n Invalid date: ".$start_date;
}
should suffice. though i tend to distrust my data. i would use a
slightly more complex regex to be sure that what is between
the beginning of the string and the first '/' was a valid month:
if ($start_date !~ m,^(:?0?[1-9]|1[012])/,)
{
$date_okay = "N"; print "\n Invalid date: ".$start_date;
}
additionally, you could build a %hash with keys corresponding
to valid values and check that $hash{$month_guess} 'exists', or
one of many more techniques.
good luck,
--
dan boorstein <dboorstein@shopcfn.com>
------------------------------
Date: 12 Feb 1998 14:46:25 -0500
From: kcohen@julius.ling.ohio-state.edu (Kevin B Cohen)
Subject: does perl store the shattered remains of an attempted match?
Message-Id: <6bvjih$cgb@julius.ling.ohio-state.edu>
perl is so generous to us with Special Variables that i thought there
might be one for this...
sometimes a match fails, but i'd like to know if it was able to match
even some bit, particularly towards its leftmost edge. for instance,
if i've got some RE like
(dog|cat|trilobite)\s<bunch of arcane stuff here>
i might want to know something like "if it failed, did it at least
reach the bunch of arcane stuff?"
is that stored anywhere? maybe that's a lot to ask from a
nondeterministic finite state machine....
kevin
------------------------------
Date: Thu, 12 Feb 1998 10:58:50 GMT
From: creepy@!domain.com (sean broderick)
Subject: Re: FAQless Forays (was: Code Example Needed)
Message-Id: <creepy-1202981258500001@10.0.2.15>
</christainsen making a valid point>
Further investigation revealed a depressing but indisputable correlation:
nearly all such postings were written by someone using a PC (meaning Mac
or Windows) system, more often than not using a web browser with a lame,
patched-together USENET interface rather than a dedicated newsreader tool.
I'll tell you what: *you* go read a few hundred such repeated questions
from lazy and clueless people who refuse to avail themselves of the
hundreds of pages of free documentation included with every single Perl
distribution, work that you have personally devoted untold months of your
life to, and then then tell me whether you don't find yourself on the
brusque side. I'll bet you would.
Most of the FAQ questions came from Prisoners of $Bill, and most of the
PoB postings were FAQs. This is a culture clash in the extreme.
</christiansen ends>
let me first say, mr. christiansen, that i am a fan of your writing ^_^
on the other hand, i could not live without my macintosh, which satisfies
my primitive needs without requiring me to learn many archaic utilities or
spend huge amounts of money on windowing software...
(* just don't start with linux, i would not want to use an
intel-architecture personal computer for *anything* *)
emacs is a way of life, hmmm--no thanks.
your perspective of primitive computer users with regard to usenet abuse
is great, but i just hate the macintosh community being lumped together
with the windows community--those *cultures* are very different, too.
i wonder how you are going to treat the macintosh when its mach kernel
(via "yellow box" os) is released?
sean broderick
once an engineer, always...
no spam please: <luser: direwolf & server/domain: world.std.com>
------------------------------
Date: Thu, 12 Feb 1998 14:07:54 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: FAQless Forays (was: Code Example Needed)
Message-Id: <fl_aggie-1202981407540001@aggie.coaps.fsu.edu>
In article <34e21d67.0@news1.ibm.net>, "Phil Jach - Reverse to get
address" <moc.care@hcajp - Reverse to get address> wrote:
+ I've been learning Perl for about 9 months. I think I've posted a question
+ here maybe 3 times tops. Those 3 times I posted, I didn't bother to read
+ the FAQ or check to see if someone else had already posted the question and
+ received an answer.
You must not have seen my post to someone else about this.
Why do you think you'll receive an answer from UseNet sooner than from
the available ON-LINE and SEARCHABLE documentation? Why do you expect that
any answers you get will be CORRECT?
+ The reason I didn't, is because sometimes I have way to many things going
+ on. As most IT professionals know, there is always something to be learned
+ and never enough time to read it all.
And if you where professional enough about it, you'd realize that you're
imposing on other people's time, resources and effort without recompense,
and endeavor to either a) take the time to find out yourself, or b) take
the time to answer questions that you know the answer.
I can't say I've seen you post much, Phil...
This attitude of "gimme gimme gimme" is not new. It is, however, beginning
to get to be a bit much. I am unhappy to point out that I have had my
perl corrected by Larry Wall on this group. I'm unhappy, not that he
corrected me, but rather that he's not here to share his wit and wisdom
with you new comers. But that's your loss, and a direct consequence of
"gimme gimme gimme".
Remember that the next time you fail to do your homework.
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: Thu, 12 Feb 1998 11:51:37 -0600
From: jase@cadence.com
Subject: Help installing Text::NWrap
Message-Id: <887305443.1730674691@dejanews.com>
I'm attempting to install the Text-Format+NWrap0.11 package which includes
the Text::NWrap routine. It compiles fine with 'make', but 'make test'
produces this output:
PERL_DL_NONLAZY=1 /usr/local/bin/perl -I./blib/arch -I./blib/lib -
I/usr/local/lib/perl5/sun4-solaris/5.003 -I/usr/local/lib/perl5 -e 'use
Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
t/*.................Can't open perl script "t/*.t": No such file or
directory
FAILED before any test output arrived
Test returned status 2 (wstat 512)
FAILED--1 test script could be run, alas -- no output ever seen
*** Error code 29
make: Fatal error: Command failed for target `test_dynamic'
And if I try to use Text::NWrap in a script, I get these errors:
Bareword "_text" not allowed while "strict subs" in use at
/usr/local/lib/perl5/site_perl/Text/Format.pm line 305.
Bareword "_findent" not allowed while "strict subs" in use at
/usr/local/lib/perl5/site_perl/Text/Format.pm line 308.
[etc.]
Any ideas or suggestions why this isn't working? I'm trying to install it
with Perl version "5.003 with EMBED" on a Solaris 2.5.1 machine.
Thanks,
jase@cadence.com
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 12 Feb 1998 19:33:46 GMT
From: Zenin <zenin@best.com>
Subject: Re: How do I export environment variables?
Message-Id: <887312290.611033@thrush.omix.com>
[posted & mailed]
Tom Christiansen <tchrist@mox.perl.com> wrote:
>snip<
: Hm... my new killfile isn't detecting you're posting from Windows.
: Darn it.
I'm surprised Tom, how could it miss the "X-Mailer: Mozilla 4.01 [en] (WinNT;
U)" header line? Personally, I find the attempted use of Netscape as a
newsreader even worse then the attempted use of WinNT as an OS. :-)
But the combination.... *sutters*
--
-Zenin
zenin@best.com
------------------------------
Date: Thu, 12 Feb 1998 14:22:10 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: How the Hell do I...?
Message-Id: <fl_aggie-1202981422100001@aggie.coaps.fsu.edu>
In article <6buju8$iuk$1@nz12.rz.uni-karlsruhe.de>,
Marc.Haber-usenet@gmx.de (Marc Haber) wrote:
+ UNIXites may know that deleting is done with the unlink command. Most
+ DOS and Windows people without a UNIX background simply don't know
+ this.
That's nice. That's also no excuse. I didn't know that, either. A quick
persual of the Camel book - you _do_ have a copy, don't you? - would but
you in the index, looking for "delete", yes? which points to the "delete"
function on pg 156 of the Blue Camel, which has a curious note:
It doesn't delete a file. See _unlink_ for that.
What, exactly, was hard about that?
+ Tom, please think about your attitude. You are not only rude to
+ newbies, but you are also not doing the perl community a good service
+ by scaring new people off.
Ah, but its ok for newbies to be rude and ask any ol' question?
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: Thu, 12 Feb 1998 08:55:22 -0700
From: NerveGas <NerveGas@see_signature.com>
Subject: Re: HUMOR: Userspeak vs Hackerspeak
Message-Id: <34E31B1F.1D99@see_signature.com>
Tom Christiansen wrote:
>
> C:\ root#
> ============= =================
{snip}
> getting help paying a consultant
What? The mighty "Real Programmer" Tom Christiansen paying others to
do his work? Tell me it isn't so! : )
steve
--
------------------------------
Date: Thu, 12 Feb 1998 19:29:12 GMT
From: stephen farrell <sfarrell+usenet@farrell.org>
Subject: Re: LWP.pm Question
Message-Id: <87vhukwrjr.fsf@phaedrus.uchicago.edu>
Michael DeVivio <omc@worldnet.att.net> writes:
> [1 <text/plain; us-ascii (7bit)>]
> Hello,
>
> I am a beginner Perl programmer. I have a program that runs on the
> command line fine:
>
> > print "Content-type: text/html\n\n";
> >
> > use LWP::Simple;
> >
> > $myfile = get "http://www.anyserver.com/anycgi.pl";
> >
> > print "$myfile";
> >
what is this supposed to accomplish, anyway? Why not just point your
web browser to "http://www.anyserver.com/anycgi.pl"?
> when i type "perl5 program.cgi" it works great but whe I try to run it
> from a browser adding "#!/usr/bin/perl5" at the top it no longer works.
> Why is this?
What happens when you put #!/usr/bin/perl5 at the top, chmod u+x it,
and then type ./program.cgi?
> When I type whereis perl5 I get:
>
> > /usr/bin/perl5
> >
> I get a 500 error on the page. So I am confused since I added the
> content-type line and all.
This could be a large number of things, esp including the config of
the server. I used to use a netscape server that would give an error
if there was any output to stderr. What does it say in the log file?
Anyway, definitely not a perl question (sorry). Ask this part in one
of those infosystems.www newsgroups.
> Thank you for your input. My e-mail address is omc@worldnet.att.netX
> (minus the X at the end to prevent spam). :)
Well, usually ppl put the X in the email address that appears in the
header.
--sf
------------------------------
Date: Thu, 12 Feb 1998 17:55:08 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Newbie needs HELP
Message-Id: <EoA1rw.5y3@world.std.com>
"David W. Smith" <davidsmith@tidalwave.net> writes:
>I thought something like:
>chdir ("c:\newdir");
>mkdir ("newroot", 0755);
>chdir (c:\newdir\newroot");
>mkdir ("newsubdirectory", 0755);
Check your chdir() calls to see if they succeed.
chdir ("c:\newdir") or die "Can't chdir to c:\newdir: $!\n";
You'll probably notice something odd in the error message:
Can't chdir to c:
ewdir: No such file or directory
The "\n" in "\newdir" got converted into a newline. Thats because
double quoted strings perform backslash interpretation (as well as
interpolation.)
There is an FAQ entry about this, but to be fair, I can't imagine how
you could have found it from the symptoms that you experienced. "Why
can't I use "C:\temp\foo" in DOS paths? What doesn't
`C:\temp\foo.exe` work?"
<URL:http://www.perl.com/CPAN-local//doc/manual/html/pod/perlfaq5/
Why_can_t_I_use_C_temp_fo_in.html>
--
Andrew Langmead
------------------------------
Date: Thu, 12 Feb 1998 18:03:44 GMT
From: Marc.Haber-usenet@gmx.de (Marc Haber)
Subject: Re: on reading FAQs and gurus answering questions
Message-Id: <6bvdic$nj3$1@nz12.rz.uni-karlsruhe.de>
Randal Schwartz <merlyn@stonehenge.com> wrote:
>I think for me it means more the passing of an era. When people
>*used* to understand that Usenet was more than a "help desk". That
>"give a little, get a little" was the norm, instead of the exception.
"Give a little, get a little" is the formular that makes Usenet work.
But you gotta see Usenet as a whole, not only clpm. Who doesn't have a
clue about perl might be a Windows NT, X or hardware wizard and may
perhaps spend as much time as you do here "answering" FAQs in "his"
home group.
Greetings
Marc
--
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber | " Questions are the | Mailadresse im Header
Karlsruhe, Germany | Beginning of Wisdom " | Fon: *49 721 966 32 15
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29
------------------------------
Date: Thu, 12 Feb 1998 13:50:19 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: on reading FAQs and gurus answering questions
Message-Id: <linberg-1202981350190001@projdirc.literacy.upenn.edu>
In article <8ck9b0949r.fsf@gadget.cscaper.com>, Randal Schwartz
<merlyn@stonehenge.com> wrote:
> I used to answer about 5 to 30 messages a day in clpm. If you've
> noticed, I don't any more.
I sure have noticed, and it's something I deeply regret. But I can't say
I blame you.
I posted another note inquiring about last summer's RFD for new moderated
c.l.p. groups. It seems to me that going moderated would make things
useful again and maybe bring some valued talents back in. I hope we can
at least discuss it.
--
Steve Linberg | National Center on Adult Literacy
Systems Programmer etc. | University of Pennsylvania
linberg@literacy.upenn.edu | http://www.literacyonline.org
------------------------------
Date: 12 Feb 1998 19:22:52 GMT
From: chris+usenet@netmonger.net
Subject: Re: Perl Wizard Quiz
Message-Id: <6bvi6c$ihg$2@schenectady.netmonger.net>
Keywords: expert
[E-mailed and posted]
In article <6bt87j$req$2@csnews.cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> wrote:
> Published in a recent Perl Journal, albeit with fewer typos.
> The questions are below the program. Sharred up to protect
> from wicked nntp dot sensitivity in the format statements.
>
[...]
> # ============= ranquiz ==============
> if test -f 'ranquiz' && test "$first_param" != -c; then
> $echo 'x -' SKIPPING 'ranquiz' '(file already exists)'
> else
> shar: Saving ranquiz (text)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
> $echo 'x -' extracting 'ranquiz' '(text)'
> sed 's/^X//' << 'SHAR_EOF' > 'ranquiz' &&
I may be missing something extremely obvious. At least, that's how I
was about to start this post. But now I know what the problem is:
shar's message (probably on stderr) has been inadvertently included
in the /bin/sh script.
--
Christopher Masto <chris@netmonger.net>
Director of Operations, NetMonger Communications, Inc.
+1-516-221-6664 http://www.netmonger.net/ info@netmonger.net
------------------------------
Date: Thu, 12 Feb 1998 12:13:05 -0600
From: Cameron Dorey <camerond@mail.uca.edu>
To: Craig Berry <cberry@cinenet.net>
Subject: Re: RFC about "Matt's Script Archive"
Message-Id: <34E33BB0.8A9ACBE6@mail.uca.edu>
Craig Berry wrote:
>
> [snip]
> I *do* hope nobody's trying to learn from it [MSA Formmail], though!
>
Unfortunately, I am sure there are people out there trying to do just
that. I know, because I was once one of them (for about a week). Coming
from a scientific but not computer science background (last real
programming in Fortran in 1982), and presented with a project, I did
some homework on perl: downloaded the AS and then the GS port, (yes, I'm
one of those awful Windoze users) found the c.l.p.* NGs to _read_, sub'd
to the listservs, read all the pages on the net I could find about perl
and many of them were full of hype about how easy it was (it's easy, but
not _that_ easy) and about how you could find a ready-made script to do
whatever you wanted.
Well, I found MSA and a few other script archives, downloaded some
scripts, and went to town, finding out quickly that when a script didn't
do exactly what I needed, it was often next-to-impossible to make a
_few_ changes to fix it, but the whole thing had to be rewritten. By
that time the gecko had come out (I had been waiting with baited breath
for a while), and I started really learning the language.
Long tale, but it's obvious from postings to this NG that there are a
bunch of others who are at least in that first phase, often from a
Windows background, like me, but maybe not. It can be good that there
are scripts out there to whet your appetite, but if you don't have a
high frustration threshold, they can do more harm than good (i.e., turn
someone off to perl, because "it just don't work"). Taking the Perl4
stuff off the net, or at least giving the reader a warning like "This is
old stuff, but it will still do the job, at least if you don't mess with
it" would be a good step, IMHO.
Cameron Dorey
camerond@mail.uca.edu
"The opinions expressed above are not claimed by my employer, by me, nor
by any sentient being, in all probability."
------------------------------
Date: 12 Feb 1998 19:20:11 GMT
From: lmb@pointer.teuto.de (Lars Marowsky-Bree)
Subject: Sample, simple script which uses threads ?
Message-Id: <slrn6e6ira.pet.lmb@pointer.teuto.de>
Morning all,
I am looking for an example of how to use threads (since I finally managed
to get it working in _58;).
Like, how do I start a new thread and how do I communicate between threads.
How do I declare variables local to a thread.
I seem to have missed the relevant portion of the docs... Maybe it just
hasn't been written yet ;-)
(Don't ask me - my English is awful ;-)
Thanks,
Lars
--
Lars Marowsky-Bree :homepage email: \ geek, BOFH, psychopath, magician, /
http://teuto.net/~lmb/ lmb@teuto.net \ killer, looney, genius, pervert /
pgp-key-id: 0x09e360c5 / ff 2a 82 e8 6b 85 79 23 9c da b5 81 d4 fc 29 e6
------------------------------
Date: Thu, 12 Feb 1998 14:28:20 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Seriously Off Topic, but a Common Complaint/Problem in this NG
Message-Id: <fl_aggie-1202981428200001@aggie.coaps.fsu.edu>
In article <34E2699F.90B00D0D@us.oracle.com>, Denis Goddard
<dgoddard@us.oracle.com> wrote:
+ Cameron Dorey wrote:
+ > "Fix your word wrapping, or I _will_ killfile you."
+ I must say, while this riled me at first, it *did* prompt me to
+ resolve the problem...
For which I can say thanks! But the remark was _not_ intended to
rile you, but rather alert you that you had a problem. And that if
you chose not to take corrective action, that I would elminate the
problem from my end of things...
+ (At least I *think* it's resolved, but maybe everybody killfiled me!)
Yes. :)
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: Thu, 12 Feb 1998 13:13:19 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: So what about last summer's RFD? Let's go moderated.
Message-Id: <linberg-1202981313190001@projdirc.literacy.upenn.edu>
OK folks, we're all pretty worked up about this, and Randall's note about
how he essentially can't stand to be in here anymore -- and Tom may not be
far behind -- means it's time for some action. Tom may have ruffled some
feathers recently, but anybody who would say "good riddance" doesn't
understand Tom's stature in the Perl community. He's a TITAN. So is
Randall. So are others who are fed up.
A quick deja-news search revealed that in article
<5nmj87$282$1@nadine.teleport.com>, deckers@man.ac.uk (A. Deckers) posted
an RFD suggesting the creation of four new moderated Perl groups. To the
best of my knowledge, it died due to a general lack of tuits.
Since I'm not the author, I don't want to repost it, but you can get it on
deja news with this url:
<http://x3.dejanews.com/getdoc.xp?AN=247681383&CONTEXT=887306503.1261633791&hitnum=3>.
I don't have the skills to be a moderator, but I'd be willing to help out
however I can. I don't want to see this resource die due to stupid (and
preventable) lowest-common-denominator problems.
--
Steve Linberg | National Center on Adult Literacy
Systems Programmer etc. | University of Pennsylvania
linberg@literacy.upenn.edu | http://www.literacyonline.org
------------------------------
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 1876
**************************************