[7608] in Perl-Users-Digest
Perl-Users Digest, Issue: 1234 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 27 16:13:44 1997
Date: Mon, 27 Oct 97 13:00:33 -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 Mon, 27 Oct 1997 Volume: 8 Number: 1234
Today's topics:
Re: awk style field variables in perl <zenin@best.com>
Re: Browser redirect for MSIE4.0 (Jason Gloudon)
Re: BUG in WinPerl; OK in Unix Perl (Milivoj Ivkovic)
Class vars and "exists": Error in book (Tom Harrington)
Debugging all day and can't get rid of this one - help dixie.landerz@cooler.shaker.com
Re: Debugging all day and can't get rid of this one - h <rootbeer@teleport.com>
Re: Debugging all day and can't get rid of this one - h (Faust Gertz)
Re: Debugging all day and can't get rid of this one - h <usenet-tag@qz.little-neck.ny.us>
Fortran to Perl Converter <lavigne@houston.wireline.slb.com>
Re: Fortran to Perl Converter (Daniel E. Macks)
h2ph/perl5.004_01/linux2/ -help (h3o)
help with lists within objects? <dlw@holyrood.ed.ac.uk>
Re: help with lists within objects? <rootbeer@teleport.com>
HELP: Perl script and regular expressions (I think)! (Roger Foss)
Re: HELP: Perl script and regular expressions (I think) (Roger Foss)
Re: How to send keystrokes from Perl to Win95 app <rootbeer@teleport.com>
Internal Server Error drizzt@drizzt.stny.lrun.com
Re: Internal Server Error <rootbeer@teleport.com>
Re: Memory problems - how can I fix? (Ilya Zakharevich)
Re: Perl 5 and here documents (Faust Gertz)
perl newbie needs help <andy@solution4u.com>
Re: Sending a binary attachment with perl question? <ltorres@campus.ruv.itesm.mx>
Re: Urgent Perl question <rootbeer@teleport.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 27 Oct 1997 18:31:21 GMT
From: Zenin <zenin@best.com>
Subject: Re: awk style field variables in perl
Message-Id: <632mlp$ra$1@nntp2.ba.best.com>
Joshua Goodall <joshua@ednet.co.uk> wrote:
> Almost but not quite accurate. The default split is on \s+ - which means that
> consecutive whitespaces are ignored. I only remember this when I've been
> calling split on a syslog output and it doesn't work right for the first ten
> days of the month.
>snip<
Almost but not quite accurate. You didn't finish reading the man
page entry for split(). A split() on ' ' is a special case. To
quote the perlfunc man page, "As a special case, specifying a
PATTERN of space (' ') will split on white space just as split
with no arguments does. Thus, split(' ') can be used to emulate
awk's default behavior, whereas split(/ /) will give you as many
null initial fields as there are leading spaces.".
Therefor, the statement:
@foo = split (' ', $_) ;
IS IDENTICAL to the statement:
@foo = split;
--
-Zenin (zenin@best.com)
The Bawdy Caste (San Jose, CA) http://www.netmagic.net/~dmcgrath/bawdy/
Barely Legal (Berzerkly, CA) http://www.barelylegal.org/
Zenin's Rocky Archive (Moving soon!) http://www.best.com/~zenin/
------------------------------
Date: 27 Oct 1997 20:12:34 GMT
From: jgloudon@bbn.remove.com (Jason Gloudon)
Subject: Re: Browser redirect for MSIE4.0
Message-Id: <632sji$nie$1@daily.bbnplanet.com>
acauth1 (acauth1@swbell.net) wrote:
: Trying to find a browser redirect script that will recognize Netscape, MSIE
: 3, and MSIE 4.0 as well as others. Please let me know if anyone knows of
: one.
: Thanks,
: Robert
CGI Redirection headers that should work can be generated using the CGI perl
module which you can find by searching CPAN on www.perl.com.
Jason Gloudon
------------------------------
Date: Mon, 27 Oct 1997 10:51:40 GMT
From: ivkovic@compuserve.com (Milivoj Ivkovic)
Subject: Re: BUG in WinPerl; OK in Unix Perl
Message-Id: <34546d84.133836995@news.compuserve.com>
>There is a bug in WinPerl wherein a file which contains 0x1A can't be
>read past that point...
In Win32/DOS, you need to use binmode to specify it's a binary file,
so Ctrl-Z isn't interpreted as the End Of File character.
open F or warn "Couldn't open $F\n";
binmode F;
...etc...
My understanding is that if the script gets ported elsewhere, binmode
won't hurt; it's only unnecessary on current Unix systems.
------------------------------
Date: 27 Oct 1997 19:54:14 GMT
From: tph@longhorn.uucp (Tom Harrington)
Subject: Class vars and "exists": Error in book
Message-Id: <632rh6$sou1@eccws1.dearborn.ford.com>
I've been attempting to grok the use of class instance vars and
the meaning of "exists" regarding them, but my results don't match
what the Camel book seems to indicate. As a sanity check, I typed
in the example from pp. 298-299, and found that it doesn't work.
I checked out O'Reilly's errata page for the book, and there are
some corrections, but they don't seem relevant to my copy somehow;
they indicate changing references to something called "_permitted"
which does not appear in the example...
If someone knows how this example needs to be modified to work,
I'd really appreciate an explanation. I'm using Perl 5.003, and
my copy of the Camel book says it was printed in September 1996.
The example is as follows:
--- Person.pm ---
package Person;
use Carp;
my %fields = {
name => undef,
age => undef,
peers => undef,
};
sub new {
my $that = shift;
my $class = ref($that) || $that;
my $self = {
%fields,
};
bless $self, $class;
return $self;
}
sub AUTOLOAD {
my $self = shift;
my $type = ref($self) || croak "$self is not an object";
my $name = $AUTOLOAD;
$name =~ s/.*://;
unless(exists $self->{$name}) {
croak "Can't access '$name' field in object of class $type";
}
if(@_) {
return $self->{$name} = shift;
} else {
return $self->{$name};
}
}
--- Persontest ---
#!/usr/local/bin/perl5 -w
use Person;
$him = new Person;
$him->name("Jason");
$him->age(23);
$him->peers(["Norbert", "Rhys", "Phineas"]);
printf "%s is %d years old.\n",$him->name, $him->age;
print "His peers are: ", join(", ", @{$him->peers}), ".\n";
-----
If I type this in and run it, the attempt to assign $him->name("Jason")
triggers the "croak" statement in sub AUTOLOAD. The "-w" gives no
clues at all. I'd like to implement some checking for whether instance
vars exist. But I'd like it to work. :-)
--
Tom Harrington --------- tph@rmii.com -------- http://rainbow.rmii.com/~tph
"Rock 'n' Roll, as a sound, is what grandparents listen to."
-Fraser Clark, Mondo 2000
Cookie's Revenge: ftp://ftp.rmi.net/pub2/tph/cookie/cookies-revenge.sit.hqx
------------------------------
Date: Mon, 27 Oct 1997 17:10:46 GMT
From: dixie.landerz@cooler.shaker.com
Subject: Debugging all day and can't get rid of this one - help !
Message-Id: <3454ca48.10662712@nntp.onyx.net>
This line is from a known good source (CGI Programming on the WWW -
O'Reilly), which checks fine using perl -wc filename.pl :
($student, $YOG, $address) = split (/\0/, $fields);
Whereas this line (below), which has been adapted from the above gives
the error "Backslash found where operator expected at people.pl line
174, near "= split (/\"... (Missing Operator before \?) .... Syntax
error at people line 174, near "= split (/\" .... Execution of
people.pl aborted due to compilation errors:
($staff_no, $forename, $surname, $job_title, $company, $department) =
split (/\0/, $fields);
Any suggestions you might have would be gratefully received.
Thanks in advance
------------------------------
Date: Mon, 27 Oct 1997 10:03:09 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: dixie.landerz@cooler.shaker.com
Subject: Re: Debugging all day and can't get rid of this one - help !
Message-Id: <Pine.GSO.3.96.971027095821.15628O-100000@usertest.teleport.com>
On Mon, 27 Oct 1997 dixie.landerz@cooler.shaker.com wrote:
> "Backslash found where operator expected at people.pl line
> 174, near "= split (/\"... (Missing Operator before \?) .... Syntax
> error at people line 174, near "= split (/\" .... Execution of
> people.pl aborted due to compilation errors:
>
> ($staff_no, $forename, $surname, $job_title, $company, $department) =
> split (/\0/, $fields);
There's nothing wrong with that line that I can see, but I'd guess that
you've got an error on a previous line which is confusing the parser.
Probably you've got a mis-quoted regular expression on the previous line?
Look closely at the three or four previous lines and you'll probably see
the problem. Good luck!
--
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/
Ask me about Perl trainings!
------------------------------
Date: Mon, 27 Oct 1997 19:56:42 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Re: Debugging all day and can't get rid of this one - help !
Message-Id: <3454ee2e.1922594@news.wwa.com>
On Mon, 27 Oct 1997 17:10:46 GMT, dixie.landerz@cooler.shaker.com
wrote:
>the error "Backslash found where operator expected at people.pl line
>174, near "= split (/\"... (Missing Operator before \?) .... Syntax
>error at people line 174, near "= split (/\" .... Execution of
>people.pl aborted due to compilation errors:
>
>($staff_no, $forename, $surname, $job_title, $company, $department) =
>split (/\0/, $fields);
Try commenting out the line and see if you still get an error. My
guess is that the error is the result of a typo in a previous line.
Also, the code from that book isn't so great. For example, it doesn't
necessarily run under -w, -T, or use strict;.
HTH
Faust Gertz
Philosopher at Large
------------------------------
Date: 27 Oct 1997 19:31:30 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: Debugging all day and can't get rid of this one - help !
Message-Id: <eli$9710271410@qz.little-neck.ny.us>
Posted and mailed.
<dixie.landerz@cooler.shaker.com> wrote:
> Whereas this line (below), which has been adapted from the above gives
> the error "Backslash found where operator expected at people.pl line
> 174, near "= split (/\"... (Missing Operator before \?) .... Syntax
> error at people line 174, near "= split (/\" .... Execution of
> people.pl aborted due to compilation errors:
>
> ($staff_no, $forename, $surname, $job_title, $company, $department) =
> split (/\0/, $fields);
There is absolutely nothing wrong with this. Your problem lies somewhere
before this line where you have a stray /, which is being interpreted as
a regular expression ending just before the \0.
Elijah
------
perl should give you a "runaway multi-line // string" error for that
------------------------------
Date: Mon, 27 Oct 1997 23:12:29 -0800
From: Jack LaVigne <lavigne@houston.wireline.slb.com>
Subject: Fortran to Perl Converter
Message-Id: <3455905D.4B5B@houston.wireline.slb.com>
I have a fairly large library
of fortran routines (about 200).
They are simple in the sense that
the inputs are numbers or arrays
and the outputs are the same.
They are stand-a-lone.
I have manually converted about
five of them to perl. It is quite
time-consuming and tedious.
I am looking for a fortran to
perl converter. I don't care
if it works perfectly as long
as I have a nice starting place
that cuts down on the the "$" signs
and ";" that I have to input.
Anyone have such an animal?
------------------------------
Date: 27 Oct 1997 19:47:36 GMT
From: dmacks@sas.upenn.edu (Daniel E. Macks)
Subject: Re: Fortran to Perl Converter
Message-Id: <632r4o$vj0$1@netnews.upenn.edu>
Jack LaVigne (lavigne@houston.wireline.slb.com) said:
: I have a fairly large library
: of fortran routines (about 200).
:
: They are simple in the sense that
: the inputs are numbers or arrays
: and the outputs are the same.
:
: They are stand-a-lone.
Since the routines are modular, perhaps it might be possible to just
create my_old_fortran_subs.pm? I briefly toyed with the opposite
direction (embedding perl in fortran) but got side-tracked.
dan
--
Daniel Macks
dmacks@a.chem.upenn.edu
dmacks@netspace.org
http://www.netspace.org/~dmacks
------------------------------
Date: Sun, 26 Oct 1997 16:05:11 +0200
From: h3o@veda.is (h3o)
Subject: h2ph/perl5.004_01/linux2/ -help
Message-Id: <h3o-ya02408000R2610971605110001@news.proventum.net>
please post or reply personally to pervious mwessage
andrew mckenzie
h3o@veda.is
------------------------------
Date: Mon, 27 Oct 1997 17:39:09 +0000
From: D L Warnett <dlw@holyrood.ed.ac.uk>
Subject: help with lists within objects?
Message-Id: <Pine.GSO.3.95.971027173049.27632A-100000@holyrood.ed.ac.uk>
Dear all,
I'm not sure if i'm missing something obvious but i can't seem to create a
list within an object and then get at the elements of that list.. I'm
trying to do something like the following.
within package Obj1....
sub init {
my $self = shift;
$self->{'list'} = \(new Obj2, new Obj2, new Obj2);
}
sub get_info {
my $self = shift;
foreach $obj_ref (@{$self->{'directions'}}) {
print $obj_ref->{'last'};
}
}
######
Or something like this...
The perldebugger within emacs tells me that @{$self->{'directions'}} is
not an ARRAY reference..
I've tried everyhing i can think of - please help!
thanks, in advance,
lawrence
(dlw@holyrood.ed.ac.uk)
------------------------------
Date: Mon, 27 Oct 1997 10:40:07 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: D L Warnett <dlw@holyrood.ed.ac.uk>
Subject: Re: help with lists within objects?
Message-Id: <Pine.GSO.3.96.971027103733.15628S-100000@usertest.teleport.com>
On Mon, 27 Oct 1997, D L Warnett wrote:
> $self->{'list'} = \(new Obj2, new Obj2, new Obj2);
That syntax doesn't do what you probably think. I think you want this.
$self->{'list'} = [new Obj2, new Obj2, new Obj2];
See perlref(1) for details. Does that get you any closer? 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/
Ask me about Perl trainings!
------------------------------
Date: Mon, 27 Oct 1997 19:03:56 +0100
From: roger.foss@oslo.itservice.telenor.no (Roger Foss)
Subject: HELP: Perl script and regular expressions (I think)!
Message-Id: <MPG.ebef5ec4c77aadf98969d@134.47.108.15>
Hello, everyone.
I'm trying to use a DOS perl script that Novell Consulting wrote for
automating Netware installations. However, at some point it stops
executing the script and displays the following error:
/; *** NWInDOS *** Install DOS/: nested *?+ in regexp at NWINDOS line
849, <> line 3.
I'm no perl programmer myself, but I was hoping someone in this newsgroup
could help.
The offending line is in the function / procedure below. I've pasted in
the entire subroutine, but the offending line is number 9 below -- the
one that says $comment =~ s/"[^"]*"//g ; # remove quoted
strings.
Could someone point out the error and tell me how to fix this?
(I'm using PERL386.EXE (Perl 4), but get the same error with Perl 5 for
DOS.)
Thank you - I really need this!
Roger Foss
#
************************************************************************
# Read in the file containing the parameters we need
sub ReadParamFile
{
$curLine = 0 ;
while ( <> )
{
$curLine++ ;
$comment = $_ ; # for removing comments
$comment =~ s/"[^"]*"//g ; # remove quoted strings
s/$1// if $comment =~ /([;#].*)/ ; # now remove comments
next if /^\s*$/ ; # skip blank lines
chop ;
s/"([^"]*)"/$1/ ; # remove quotes
($key, $value) = split(/\s*=\s*/, $_, 2) ; # get the keyword & value
$key =~ tr/[A-Z]/[a-z]/ ;
$value =~ s/^\s*// ; # remove leading & trailing
$value =~ s/\s*$// ; # white space
print "$key, $value\n" if $debug ;
if ( ! $response ) # Remember the filename
{
$response = $ARGV ;
# Make sure it starts with a leading \
if ( ! ($response =~ /^[a-zA-Z]:/) )
{
$response = "\\$response" if $response =~ /^[^\\]/ ;
}
print "Processing file $response ($ARGV)\n" if $debug ;
}
if ( $key eq "wipe" )
{
$value =~ tr/a-z/A-Z/ ; # get it all into uppercase
while ( $value ) # see what we're asked to wipe
{
($wipe, $value) = split(/\s*,\s*/, $value, 2) ;
if ( $wipe eq "ALL" )
{
$wipeALL = "Y" ;
}
elsif ( $wipe eq "DOS" )
{
$wipeDOS = "Y" ;
}
elsif ( ($wipe eq "NW") || ($wipe eq "NETWARE") )
{
$wipeNW = "Y" ;
}
else
{
&MyDieIn("Illegal value for WIPE `$wipe'") ;
}
}
}
elsif ( $key eq "installdir" )
{
$value =~ tr/a-z/A-Z/ ;
($insPath, $insPath2, $insBat) = split(/\s*,\s*/, $value) ;
$nextIns = $insBat if $insBat ;
$insPath =~ s/\//\\/g ;
$insPath =~ s/([^:])\\$/$1/ ;
&MyDieIn("Invalid installation directory $insPath") if ! ($insPath
=~ /^([A-Z]:)\\/) ;
$insDrive = $1 ;
$insPath =~ s/^[A-Z]:// ;
if ( $insPath2 )
{
$insPath2 =~ s/\//\\/g ;
$insPath2 =~ s/([^:])\\$/$1/ ;
&MyDieIn("Invalid secondary installation directory $insPath2") if
! ($insPath2 =~ /^([A-Z]:)\\/) ;
}
}
elsif ( $key eq "dosfree" )
{
&MyDieIn("Invalid free space requirement $value") if !($value =~
/[1-9][0-9]*[Mm]/) ;
$free = $value ;
}
elsif ( $key eq "dospart" )
{
$value =~ tr/a-z/A-Z/ ;
if ( $value ne "MAX" ) # Must be #M
{
&MyDieIn("Invalid DOS partition size $value") if !($value =~ /[1-
9][0-9]*M/) ;
chop $value ;
}
$partMb = $value ;
}
elsif ( $key eq "dospartmb" )
{
$partMb = $value ;
&MyDieIn("Invalid DOS partition size $partMb") if $partMb =~ /[^0-
9]/ ;
}
elsif ( $key eq "doslabel" )
{
$label = $value ;
&MyDieIn("Invalid DOS volume lavel $label") if length($label) > 11
;
}
elsif ( $key eq "dossrc" )
{
$value =~ tr/a-z/A-Z/ ;
( $src = $value ) =~ s/\//\\/g ;
$src =~ s/([^:])\\$/$1/ ;
}
elsif ( $key eq "dosdest" )
{
$value =~ tr/a-z/A-Z/ ;
($drive, $dest) = split(/\s*,\s*/, $value, 2) ;
&MyDieIn("No destination DOS drive number") if ! $dest ;
&MyDieIn("Invalid drive number $drive") if $drive =~ /[^0-9]/ ;
&MyDieIn("Invalid drive number $drive") if ($drive < 0) || ($drive
> 3) ;
&MyDieIn("No destination DOS path") if ! $dest ;
$dest =~ s/\//\\/g ;
$dest =~ s/([^:])\\$/$1/ ;
&MyDieIn("Invalid destination DOS path") if ! ($dest =~ /^([A-
Z]:)/) ;
$letter = $1 ;
$dest =~ s/^[A-Z]:// ;
&MyDieIn("Invalid destination DOS path") if $dest && ! $dest =~
/^\\/ ;
}
elsif ( $key eq "dosdriver" )
{
push(@configLines, "Device = $value") ;
}
elsif ( $key eq "dosconfig" )
{
push(@configLines, $value) ;
}
elsif ( ($key eq "dostsr") || ($key eq "dosauto") )
{
push(@autoLines, $value) ;
}
elsif ( $key eq "dospath" )
{
$value =~ tr/a-z/A-Z/ ;
$value =~ s/\//\\/g ;
$value =~ s/([^:])\\$/$1/ ;
$path .= ";" if $path ;
$path .= $value ;
}
elsif ( $key eq "dosperl" )
{
$perl = $value ;
}
elsif ( $key eq "doscopy" )
{
$value =~ tr/a-z/A-Z/ ; # get it all into uppercase
while ( $value ) # see what we're asked to copy
{
($copy, $value) = split(/\s*,\s*/, $value, 2) ;
($copy, $tmpDest) = split(/\s*=>\s*/, $copy, 2) ;
$copy =~ s/\//\\/g ; # convert /s to \s
$copy =~ s/([^:])\\$/$1/ ; # remove any trailing \s (except C:\)
# must start drive:\ ...
&MyDieIn("Invalid copy path $copy") if ! ($copy =~ /^[A-Z]:\\/) ;
if ( $tmpDest )
{
$tmpDest =~ s/\//\\/g ; # convert /s to \s
$tmpDest =~ s/([^:])\\$/$1/ ; # remove any trailing \s
(except \)
&MyDieIn("Invalid copy destination path $tmpDest")
if ! ($dest =~ /^([A-
Z]:)?\\/) ;
}
else
{
($tmpDest = $copy) =~ s/^[A-Z]:// ; # (dest is same w/out
drive)
}
($test = $copy) =~ s/\\/\\\\/g ;
if ( grep(/^$test$/, @copyDirs) ) # Already have this copy?
{
&MyWarn("Duplicate copy from $copy ignored") ;
}
else
{
push(@copyDirs, $copy) ;
$destDirs{$copy} = $tmpDest ;
}
}
}
elsif ( $key eq "dosmkdir" )
{
$value =~ tr/a-z/A-Z/ ; # get it all into uppercase
while ( $value ) # see what we're asked to copy
{
($md, $value) = split(/\s*,\s*/, $value, 2) ;
$md =~ s/\//\\/g ; # convert /s to \s
$md =~ s/\\$// ; # remove any trailing \s
# must start drive:\ ...
&MyDieIn("Invalid directory to create $md") if ! ($md =~ /^[A-
Z]:\\/) ;
push(@mkdirs, $md) ;
}
}
elsif ( $key eq "dosclient" )
{
$value =~ tr/a-z/A-Z/ ;
($client, $clientSrc, $clientMLID) = split(/\s*,\s*/, $value, 3) ;
if ( ($client ne $clientVLM) && ($client ne $clientNETX) )
{
&MyDieIn("Invalid client type $client") ;
}
&MyDieIn("No client source directory given") if ! $clientSrc ;
&MyDieIn("No MLID given") if ! $clientMLID ;
$clientSrc =~ s/([^:])\\$/$1/ ;
($clientDir = $clientSrc) =~ s/^[A-Z]:// ;
}
elsif ( $key eq "dosnetworkdrive" )
{
($netDrive = $value) =~ tr/a-z/A-Z/ ;
$netDrive =~ s/:$// ;
&MyDie("Invalid network drive letter $value")
if (length($netDrive) > 1) || ($netDrive gt "Z") || ($netDrive
lt "E");
}
elsif ( $key eq "dosnetcfg" )
{
($head, $value) = split(/\s*,\s*/, $value, 2) ;
# Check that we have a reasonable name for the header/option
if ( (! ($head =~ /^NetWare DOS Requester/i)) &&
(! ($head =~ /^NetWare DOS TSA/i)) &&
(! ($head =~ /^TBMI2/i)) &&
(! ($head =~ /^Transport Provider/i)) &&
(! ($head =~ /^Protocol/i)) &&
(! ($head =~ /^Desktop SNMP/i)) &&
(! ($head =~ /^Named Pipes/i)) &&
(! ($head =~ /^NetBIOS/i)) &&
(! ($head =~ /^Link Driver/i)) &&
(! ($head =~ /^Link Support/i)) )
{
&MyDieIn("Invalid $netcfg option $head") ;
}
push(@netcfg, "") if $#netcfg >= $[ ;
push(@netcfg, $head) ;
$req = ($head =~ /^NetWare DOS Requester/i) ;
# Now add in the values/settings for this header/option
while ( $value )
{
($l, $value) = split(/\s*,\s*/, $value, 2) ;
next if $req && ($l =~ /^First\s*Network\s*Drive\s*=/i) ;
push(@netcfg, " $l") ;
}
}
elsif ( $key eq "doslogin" )
{
$login = $value ;
}
elsif ( $key eq "dosremove" )
{
$value =~ tr/a-z/A-Z/ ;
while ( $value ) # see what we're asked to
delete
{
($remove, $value) = split(/\s*,\s*/, $value, 2) ;
$remove =~ s/\//\\/g ; # convert /s to \s
push(@removeFiles, $remove) ;
}
}
elsif ( $key eq "doskeep" )
{
$value =~ tr/a-z/A-Z/ ;
push(@keepFiles, $value) ;
}
elsif ( $key eq "keep" ) # Keep = DOS, NetWare etc
{
$value =~ tr/a-z/A-Z/ ;
while ( $value ) # see what we're asked to keep
{
($one, $value) = split(/\s*,\s*/, $value, 2) ;
push(@keep, $one) ;
}
}
elsif ( $key eq "upgrade" ) # Upgrade = DOS, 402, etc
{
$value =~ tr/a-z/A-Z/ ;
while ( $value ) # see what we're asked to
upgrade
{
($one, $value) = split(/\s*,\s*/, $value, 2) ;
push(@upgrade, $one) ;
}
}
$curLine = 0 if eof ; # Keep counting line numbers
}
}
------------------------------
Date: Mon, 27 Oct 1997 19:07:51 +0100
From: roger.foss@oslo.itservice.telenor.no (Roger Foss)
Subject: Re: HELP: Perl script and regular expressions (I think)!
Message-Id: <MPG.ebef6d312a6575a98969e@134.47.108.15>
Sorry, I forgot!
Please cc-by-mail your reply to roger.foss@oslo.itservice.telenor.no, if
you could.
Roger Foss
Telenor Bedrift
------------------------------
Date: Mon, 27 Oct 1997 09:37:54 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "L. Dwynn Lafleur" <lafleur@usl.edu>
Subject: Re: How to send keystrokes from Perl to Win95 app
Message-Id: <Pine.GSO.3.96.971027093557.15628K-100000@usertest.teleport.com>
On 27 Oct 1997, L. Dwynn Lafleur wrote:
> Is it possible to send keystrokes from a running Perl script to a Win95
> application that the script has opened? For example, from a Perl
> script, can I open Notepad and then issue a command in the script to
> insert a text string into the Notepad document?
Why not just use Perl to edit the document directly? But you're probably
looking to do this with something more sophisticated than Notepad.
> If not, does anyone know of a Win95 scripting language in which this can
> be done?
If it can be done in any Win95 scripting language it can be done in Perl -
although the module to make it possible may not yet be written. Good luck!
--
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/
Ask me about Perl trainings!
------------------------------
Date: Mon, 27 Oct 97 12:27:09
From: drizzt@drizzt.stny.lrun.com
Subject: Internal Server Error
Message-Id: <NEWTNews.877973364.9627.drizzt@drizzt.stny.lrun.com>
In setting up scripts on my server, I keep getting
an error 500, or 'Internal Server Error'..
Does anyone know what the reason for this is?
I _can_ run some scripts, but most give the above
error whenever they are run.
Thanks
------------------------------
Date: Mon, 27 Oct 1997 10:03:35 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: drizzt@drizzt.stny.lrun.com
Subject: Re: Internal Server Error
Message-Id: <Pine.GSO.3.96.971027100319.15628P-100000@usertest.teleport.com>
On Mon, 27 Oct 1997 drizzt@drizzt.stny.lrun.com wrote:
> In setting up scripts on my server, I keep getting
> an error 500, or 'Internal Server Error'..
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN. Hope this helps!
http://www.perl.com/CPAN/
http://www.perl.org/CPAN/
http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.org/CPAN/doc/manual/html/pod/
--
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/
Ask me about Perl trainings!
------------------------------
Date: 27 Oct 1997 20:29:19 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Memory problems - how can I fix?
Message-Id: <632tiv$qhg$1@agate.berkeley.edu>
In article <Pine.GSO.3.96.971027073149.15628F-100000@usertest.teleport.com>,
Tom Phoenix <rootbeer@teleport.com> wrote:
> On Mon, 27 Oct 1997, Ryan wrote:
>
> > I realise that perl can't free() up a block of memory back to the
> > OS, but shouldn't perl be able to reuse memory it's already allocated?
>
> It can and does reuse memory, with one notable exception (unreachable
> circular data structures). If you find other situations in which it fails
> to re-use reclaimable memory, please file a bug report with perlbug.
> Thanks!
There are also pseudo-leaks to "targets". They are not real leaks,
since they do not accumulate in loops, but whatever is got into a
target (in slang, used as a "temporary variable") stays there.
$a = "a";
$aa = $a x 1e6;
Here $a x 1e6 is avaluated assigned to a target, then this data is
assigned to $aa. Target remains forever.
There are also constant-folder monsters, like in
$aaa = "a" x 1e6;
The expression on the right is avaluated in compile-time, and also
stays. These guys may *significantly* speed up things in loop, so I'm
not sure they should *just go*, some subtler solution may be needed.
Ilya
------------------------------
Date: Mon, 27 Oct 1997 19:56:44 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Re: Perl 5 and here documents
Message-Id: <3456f041.2453115@news.wwa.com>
On 26 Oct 1997 23:59:55 GMT, steve@nospam.thisdomain.com (Steve
Walker) wrote:
>I'm having problems with a script that uses lots of here documents. I keep
>getting the error:
>
> Can't find string terminator " end_of_html" anywhere before EOF at
>class_ad_test.cgi line 905.
[snip]
>Any ideas?
My guess is that you uploaded the script from a DOS machine in
binary mode, and that there is a ^M or something like that after the
string terminator. Please do not use binary or auto-mode, but force
all scripts to be uploaded in ASCII mode. Though it may look like a
perl problem, it smells like an FTP problem. :-)
>Please remove the nospam part to reply by email....
I guess you didn't really need a reply via e-mail anyway.
Faust Gertz
Philosopher at Large
------------------------------
Date: Mon, 27 Oct 1997 15:58:08 -0500
From: Andy Sutorius <andy@solution4u.com>
Subject: perl newbie needs help
Message-Id: <3455005F.A61F111D@solution4u.com>
I have looked at all the FAQ's I can possibly stand.
I need to download a "freeware" editor so that I may write and compile
and debug Perl. I have Perl 4 and 5 but nothing is making sense in how
to get the program up and running.
I am a fair C++ programmer but I do not have the editor on my computer
anymore.
How can I go about getting a program to code Perl for CGI?
Please respond to sender andy@solution4u.com
and group
--
Andy Sutorius
Image Solutions
visit http://www.sutorius.com
____International Webmasters Association____
Charlotte, North Carolina Chapter
*Chairman*
http://www.irwa.org
------------------------------
Date: Mon, 27 Oct 1997 12:57:40 -0600
From: Luis Torres <ltorres@campus.ruv.itesm.mx>
Subject: Re: Sending a binary attachment with perl question?
Message-Id: <3454E424.8B44DC45@campus.ruv.itesm.mx>
Check the MIME modules... i use MIME Lite and it has been working
alright. Theres no mailto function in perl so you would have to get a
script for that too.
Greets
LT
------------------------------
Date: Mon, 27 Oct 1997 09:25:22 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Joseph June <jjune@miday.uchicago.edu>
Subject: Re: Urgent Perl question
Message-Id: <Pine.GSO.3.96.971027091908.15628J-100000@usertest.teleport.com>
On Mon, 27 Oct 1997, Joseph June wrote:
> Subject: Urgent Perl question
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> I'm working on a script that will generate a new file for some server
> firewall file. It needs to append the new portion in the file... and to
> determine where it will start appending...
Appending in this context means to add to the end of the file, so there
shouldn't be any question about where. Or do you mean inserting? Or
replacing?
> I'm using syswrite to copy over the portion of file that does not need
> to be modified...
I'm not sure why you don't simply use print. But okay... :-)
> and as soon as the nested if loops are matched... syswrite
> is blocked...
What do you mean when you say that it's blocked? Is a buffer full?
> THe problem is that even though i'm blocking syswrite AFTER the lines
> been matched... the 6 lines are being left out in the generated file...
That sounds like you're not handling partial writes properly (as described
in the docs for syswrite). Could that be it? I'd just use print and let
Perl take care of it for you. Good luck!
--
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/
Ask me about Perl trainings!
------------------------------
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 1234
**************************************