[10110] in Perl-Users-Digest
Perl-Users Digest, Issue: 3703 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 13 03:07:12 1998
Date: Sun, 13 Sep 98 00:00:30 -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 Sun, 13 Sep 1998 Volume: 8 Number: 3703
Today's topics:
kto movet.......... pomagite povalujsta! <andrewy@windoms.sitek.net>
a simple question hopefully <kaarkas@bigpond.com>
Re: a simple question hopefully <garry@america.net>
Re: a simple question hopefully <J.D.Gilbey@qmw.ac.uk>
Re: a simple question hopefully <J.D.Gilbey@qmw.ac.uk>
Re: a simple question hopefully (Ronald J Kimball)
Re: a simple question hopefully (Sam Holden)
Re: a simple question hopefully (John Moreno)
ANN: Backwards.pm <uri@sysarch.com>
Re: Bug/feature limitation regarding hex numbers. (Ilya Zakharevich)
Re: History of Perl - round 1 <mpersico@erols.com>
Re: How to getc like in C? <J.D.Gilbey@qmw.ac.uk>
Re: Passing file handles <mpersico@erols.com>
Re: PDF ?? INTERPRETER ?? <mpersico@erols.com>
Re: Perl & Java - differences and uses (David Formosa)
Re: Perl 5.004 upgrade problem <jeff@vpservices.com>
Re: Perl 5.004_04 seg fault <garry@america.net>
perl, NT, IIS, can't get script to use network drive lance_powers@yahoo.com
problem with strict refs while using GIFgraph (Bruce Z. Lysik)
Sorting Arrays of Hashes.. <vandiver@tiac.net>
thanks for the quick responses (nt) <kaarkas@bigpond.com>
Re: Trouble with Prompt in Telnet Module (Thomas L. Shinnick)
Re: turning perlpod into man documentation <mpersico@erols.com>
viewing HTML page source. MrGently@webtv.net
Re: viewing HTML page source. (Jeremy D. Zawodny)
Why does this sort work in Dos but not in Unix? kevinslew@my-dejanews.com
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 12 Sep 1998 22:07:09 +0400
From: "Andrew" <andrewy@windoms.sitek.net>
Subject: kto movet.......... pomagite povalujsta!
Message-Id: <6tfhf4$9av$27@dragon.infopro.spb.su>
kAK MOVNO NA LOKALXNOJ MA[INE (DOMA) PROWERITX FAJLY CGI, PL.
Perl U MENQ USTANOWLEN. a ^TO DALX[E???
pI[ITE NA E-Mail: andrewy@chat.ru
bUDU O^ENX BLAGODAREN!
------------------------------
Date: 13 Sep 1998 11:59:02 +1000
From: "Brad McCready" <kaarkas@bigpond.com>
Subject: a simple question hopefully
Message-Id: <01bddeba$70afe1a0$bee0868b@brad>
i have a script thats creates multiple txt files in multiple dirs. the
filenames are all numbers ie 123.txt - i have a variable with the dir and
the filename in it
$txtFile="somedir/someotherdir/123.txt"
what i want is the another variable '$filename' to have only the filename
in it ie
$filename="123.txt"
what i do at the moment works but i would like something more elegant if
possible
this is it...
$txtFile="somedir/someotherdir/123.txt"
@blah = split(/\//, $txtFile);
$filename = pop(@blah);
im sure thers gotta be a better way than this - i just cant think straight
ive been awake for 36 hours trying to get this thing going..
thanks in advance for anyhelp offered
brad mccready
kaarkas@bigpond.com
------------------------------
Date: Sun, 13 Sep 1998 02:10:38 GMT
From: Garry Williams <garry@america.net>
Subject: Re: a simple question hopefully
Message-Id: <35FB29E8.AEC5D5CF@america.net>
Your method is fine. Here's what I usually do:
($filename = $txtFile) =~ s[.*/][];
-Garry Williams
Brad McCready wrote:
>
> i have a script thats creates multiple txt files in multiple dirs. the
> filenames are all numbers ie 123.txt - i have a variable with the dir and
> the filename in it
>
> $txtFile="somedir/someotherdir/123.txt"
>
> what i want is the another variable '$filename' to have only the filename
> in it ie
>
> $filename="123.txt"
>
> what i do at the moment works but i would like something more elegant if
> possible
> this is it...
>
> $txtFile="somedir/someotherdir/123.txt"
>
> @blah = split(/\//, $txtFile);
> $filename = pop(@blah);
>
> im sure thers gotta be a better way than this - i just cant think straight
> ive been awake for 36 hours trying to get this thing going..
>
> thanks in advance for anyhelp offered
>
> brad mccready
> kaarkas@bigpond.com
------------------------------
Date: Sun, 13 Sep 1998 03:11:12 +0100
From: Julian Gilbey <J.D.Gilbey@qmw.ac.uk>
Subject: Re: a simple question hopefully
Message-Id: <35FB29C0.3E9EE0F4@qmw.ac.uk>
Brad McCready wrote:
>
> i have a script thats creates multiple txt files in multiple dirs. the
> filenames are all numbers ie 123.txt - i have a variable with the dir and
> the filename in it
>
> $txtFile="somedir/someotherdir/123.txt"
>
> what i want is the another variable '$filename' to have only the filename
> in it ie
>
> $filename="123.txt"
$filename =~ s|.*/([^/]*)|$1|;
assuming you've already copied $txtFile into $filename, otherwise,
you could use
$txtFile =~ m|([^/]*)$|;
$filename = $1;
Julian
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Julian Gilbey Email: J.D.Gilbey@qmw.ac.uk
Dept of Mathematical Sciences, Queen Mary & Westfield College,
Mile End Road, London E1 4NS, ENGLAND
-*- Finger jdg@goedel.maths.qmw.ac.uk for my PGP public key. -*-
------------------------------
Date: Sun, 13 Sep 1998 03:13:10 +0100
From: Julian Gilbey <J.D.Gilbey@qmw.ac.uk>
Subject: Re: a simple question hopefully
Message-Id: <35FB2A36.6F050EAC@qmw.ac.uk>
Julian Gilbey wrote:
>
>
> $filename =~ s|.*/([^/]*)|$1|;
>
> assuming you've already copied $txtFile into $filename, otherwise,
> you could use
>
> $txtFile =~ m|([^/]*)$|;
> $filename = $1;
Having now seen Gary Williams' post, I prefer his solution. TMTOWTDI.
Julian
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Julian Gilbey Email: J.D.Gilbey@qmw.ac.uk
Dept of Mathematical Sciences, Queen Mary & Westfield College,
Mile End Road, London E1 4NS, ENGLAND
-*- Finger jdg@goedel.maths.qmw.ac.uk for my PGP public key. -*-
------------------------------
Date: Sun, 13 Sep 1998 00:14:34 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: a simple question hopefully
Message-Id: <1df9pkc.18sd7rmsblicwN@bay1-151.quincy.ziplink.net>
Brad McCready <kaarkas@bigpond.com> wrote:
> $txtFile="somedir/someotherdir/123.txt"
>
> what i want is the another variable '$filename' to have only the filename
> in it ie
>
> $filename="123.txt"
use File::Basename.pm;
$filename = basename($txtFile);
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 13 Sep 1998 05:56:01 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: a simple question hopefully
Message-Id: <slrn6vmnjh.cbu.sholden@pgrad.cs.usyd.edu.au>
On 13 Sep 1998 11:59:02 +1000, Brad McCready <kaarkas@bigpond.com> wrote:
>i have a script thats creates multiple txt files in multiple dirs. the
>filenames are all numbers ie 123.txt - i have a variable with the dir and
>the filename in it
>
>$txtFile="somedir/someotherdir/123.txt"
>
>what i want is the another variable '$filename' to have only the filename
>in it ie
>
>$filename="123.txt"
>
>what i do at the moment works but i would like something more elegant if
>possible
>this is it...
>
>$txtFile="somedir/someotherdir/123.txt"
>
>@blah = split(/\//, $txtFile);
>$filename = pop(@blah);
>
>im sure thers gotta be a better way than this - i just cant think straight
>ive been awake for 36 hours trying to get this thing going...
Well go and get some sleep and then read the documentation that came with perl.
A simple regular expression does the job... if portability to non-unix like
systems is wanted then File::Basename might be better...
Actually now I'm having fun with this, and thus not just saying RTFM...
how about :
m|.*/(.*)|;
or
($filename) = map {scalar reverse $_} split /\//,reverse($txtFile),2;
Sam
------------------------------
Date: Sun, 13 Sep 1998 02:43:22 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: a simple question hopefully
Message-Id: <1df9w1h.q9f5ni6cl0n4N@roxboro0-060.dyn.interpath.net>
Brad McCready <kaarkas@bigpond.com> wrote:
> i have a script thats creates multiple txt files in multiple dirs. the
> filenames are all numbers ie 123.txt - i have a variable with the dir and
> the filename in it
>
> $txtFile="somedir/someotherdir/123.txt"
>
> what i want is the another variable '$filename' to have only the filename
> in it ie
>
> $filename="123.txt"
>
> what i do at the moment works but i would like something more elegant if
> possible
> this is it...
>
> $txtFile="somedir/someotherdir/123.txt"
>
> @blah = split(/\//, $txtFile);
> $filename = pop(@blah);
Why not go with something platform independent?
$txtFile="somedir/someotherdir/123.txt";
$txtFile =~ m/(\d+.txt)$/;
$filename = $1;
If you want $txtFile to just be a pathname, then use a substitution
instead.
> im sure thers gotta be a better way than this - i just cant think straight
> ive been awake for 36 hours trying to get this thing going..
Well, except for missing a semicolon, that seems to work - not what I'd
do, but...
--
John Moreno
------------------------------
Date: 12 Sep 1998 23:45:21 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: ANN: Backwards.pm
Message-Id: <x77lz8zne6.fsf@sysarch.com>
here is a working (may need some real world testing) module that reads a
file backwards by line. it benchmarks at about the same time as tom c.'s
algrithm (read file, build array of line indexes, reread file seeking
backwards using the index array) for longer files. for short files it
takes longer due to the longer compile.
i have several optimization ideas. for some reason 4 arg read or sysread
don't seem to work. i want to prepend the new block of text before the
current buffer. the OFFSET argument doesn't seem to do that. the
commented out code is below. if you can fix it or fix my brain about
that bug, do it.
i had read about a 4 argument substr (the last arg replaces the substr
like splice does). this would make the line extraction and return go
faster. another possibility is regexing the last line but you have to
check for a newline before it (or EOF in reverse). this is worth hacking
and benchmarking.
the main method uses a ref to the receiving line buffer to lower the
copy costs. tom's method uses the internal perl code for <> while i have
to depend on =. maybe i can seek backwards and use <> but i have to
delete the returned text so i don't end up with all the file in ram.
feel free to hack this up. mail changes (patch maybe overkill for such a
small module) and i will integrate them in. when we are all satisfied
with the performance and other stuff (docs, etc.) i/we will CPAN it.
uri
# test program
#!/usr/local/bin/perl -w
use strict ;
use Backwards ;
my $back_line ;
my $foo = new Backwards( shift ) ;
while( $foo->readline( \$back_line ) ) {
print $back_line ;
}
# Backwards.pm
# should be IO::File::Backwards
package Backwards ;
use strict ;
use IO::File ;
use Carp ;
my $max_read_size = 1 << 14 ;
sub new {
my( $class, $filename ) = @_ ;
my( $handle, $file_size, $seek, $self ) ;
$handle = new IO::File ;
$handle->open( $filename ) || croak "Can't open $filename $!" ;
$self = {
'file_name' => $filename,
'handle' => $handle,
'buffer' => ''
} ;
bless( $self, $class ) ;
return( $self ) ;
}
sub _prepend_buf {
my( $self ) = @_ ;
my( $seek_pos, $file_size, $handle, $read_size, $read_cnt ) ;
$seek_pos = $self->{'seek_pos'} ;
$handle = $self->{'handle'} ;
if ( defined( $seek_pos ) ) {
if ( $seek_pos <= 0 ) {
return( 0 ) ;
}
$read_size = $max_read_size ;
$seek_pos -= $max_read_size ;
}
else {
seek( $handle, 0, 2 ) ;
$file_size = $handle->tell ;
$read_size = $file_size % $max_read_size ;
$read_size = $max_read_size unless $read_size ;
$seek_pos = $file_size - $read_size ;
}
seek( $handle, $seek_pos, 0 ) ;
my $read_buf ;
# If the offset argument to read worked, we could drop the substr.
$read_cnt = sysread( $handle, $read_buf, $read_size, 0 ) ;
substr( $self->{'buffer'}, 0, 0 ) = $read_buf ;
# broken 4 arg. read
# $read_cnt = sysread( $handle, $self->{'buffer'}, $read_size, 0 ) ;
#print "READ '$read_buf'\nBUFFER '$self->{'buffer'}'\n" ;
#print "BUFFER '$self->{'buffer'}'\n" ;
( $read_cnt >= 0 ) || croak "bad read on $self->{'file_name'} $!" ;
$self->{'seek_pos'} = $seek_pos ;
return( $read_cnt ) ;
}
sub readline {
my( $self, $line_ref ) = @_ ;
my( $handle, $buf_ref, $read_cnt, $nl_index, $last_pos, $line ) ;
$handle = $self->{'handle'} ;
$buf_ref = \$self->{'buffer'} ;
$last_pos = length( $$buf_ref ) ;
$last_pos -=2 if $last_pos && substr( $$buf_ref, -1, 1 ) eq "\n" ;
while( 1 ) {
$nl_index = ( $last_pos > 0 ) ?
rindex( $$buf_ref, "\n", $last_pos ) : -1 ;
if ( $nl_index < 0 ) {
$read_cnt = $self->_prepend_buf() ;
if ( $read_cnt == 0 ) {
$$line_ref = $$buf_ref ;
$$buf_ref = '' ;
return length( $$line_ref ) ;
}
$last_pos += $read_cnt ;
$last_pos -=2 if substr( $$buf_ref, -1, 1 ) eq "\n" ;
next ;
}
$$line_ref = substr( $$buf_ref, $nl_index + 1 ) ;
substr( $$buf_ref, $nl_index + 1 ) = '' ;
return length( $$line_ref ) ;
}
}
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
uri@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: 13 Sep 1998 05:35:55 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Bug/feature limitation regarding hex numbers.
Message-Id: <6tfljr$e1r$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Martin Gregory
<mgregory@asc.sps.mot.com>],
who wrote in article <r8ogsldc0n.fsf@asc.sps.mot.com>:
> $a = 0x100000000; # 0xFFFFFFFF +1
>
> print "$a\n";
>
> $a = 4_294_967_296; # 0xFFFFFFFF +1
>
> printf("%f %x\n", $a, $a);
>
> produces this output:
>
> Integer overflow in hex number at /home/mgregory/bin/foo.pl line 1.
> 0
> 4294967296.000000 ffffffff
>
> Given that the two representations are mentioned 'in the same breath'
> in the documentation, and an integer bigger than 0xFFFFFFFF is
> specifically mentioned, it caught us by suprise that this doesn't
> work.
To see the difference, note that 4_294_967_296 is a floating point
number, not an integer. 4_294_967_295 is a float too. Last integer
for Perl on 32-bit machines is 2**31-1.
On the other hand, if one follows my reasoning that "any integer which
may be exactly represented by a float should give expected results"
(see perl6-porters archives), then this should be considered a bug
indeed. Note that before one can actually fix it, zillions of other
places in perl should be fixed as well... :-(
Ilya
------------------------------
Date: Sat, 12 Sep 1998 22:01:07 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: History of Perl - round 1
Message-Id: <35FB2763.DE2D586E@erols.com>
Hmm. You know. This sounds really stupid but what if one made a side
keypad, much like the add-on numeric keypads for laptops and put
$%@{}()_><&*~ on it? A carpal tunnel saver?
Brent Michalski wrote:
>
> Not if you get the new "Perl keyboard"!!!
>
> The :"<>?~!@#$%^&*()_+{}| keys have replaced the asdfghjklqwertyuipo
> keys. You now have to use Shift for the letters :^)
>
> Only $19.95 from Ronco.
>
> (Some assembly required)
> (Use only under close adult supervision)
> (No MSG's)
> --
> $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
> $ Brent Michalski $
> $ -- Perl Evangelist -- $
> $ E-Mail: perlguy@technologist.com $
> $ Resume: http://www.inlink.com/~perlguy $
> $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
--
#!/usr/bin/perl -- Matthew O. Persico
print "Just Another Perl Neophyte\n";
## Simplicity is a blessing when you're
## supporting the program at 2AM
------------------------------
Date: Sun, 13 Sep 1998 02:58:24 +0100
From: Julian Gilbey <J.D.Gilbey@qmw.ac.uk>
Subject: Re: How to getc like in C?
Message-Id: <35FB26C0.51B8068F@qmw.ac.uk>
Abbas Imani wrote:
>
> Hi All,
> I am trying to write a menu type of thing for my perl script. I would
> like to have one
> character input without having to hit 'enter' key. In other words I like
> to have something like
> getc in c. The getc command in Perl acts like getchar in C.
> Cheers,
> Abbas
See perlfaq5:
How can I read a single character from a file? From the
keyboard?
Julian
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Julian Gilbey Email: J.D.Gilbey@qmw.ac.uk
Dept of Mathematical Sciences, Queen Mary & Westfield College,
Mile End Road, London E1 4NS, ENGLAND
-*- Finger jdg@goedel.maths.qmw.ac.uk for my PGP public key. -*-
------------------------------
Date: Sat, 12 Sep 1998 22:03:25 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: Passing file handles
Message-Id: <35FB27ED.C50CB319@erols.com>
Since Tom is too humble to brag:
Perl Cookbook. Christansen and Torkington. O'reilly. ISBN 1-56592-243-3
FAQ on major steriods!
Tom Christiansen wrote:
>
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc, cselton@hkp.hk (cs - Elton Kong) writes:
> :I would like to know how I can pass a file handle to a sub-routine.
> :I'm played with different syntax combinations to no success. Could
> :anyone help? Thanks!
>
> This is covered in the perlsub manpage, with a bit in perldata.
> The 5.005 version can be found here:
>
> http://www.perl.com/CPAN/doc/manual/html/pod/index.html
>
> --tom
> --
> "No, I'm not going to explain it. If you can't figure it out,
> you didn't want to know anyway..." --Larry Wall
--
#!/usr/bin/perl -- Matthew O. Persico
print "Just Another Perl Neophyte\n";
## Simplicity is a blessing when you're
## supporting the program at 2AM
------------------------------
Date: Sat, 12 Sep 1998 22:18:12 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
To: RCIGROUP <rcigroup@aol.com>
Subject: Re: PDF ?? INTERPRETER ??
Message-Id: <35FB2B64.F939D62E@erols.com>
Check CPAN. I think I saw a PDF module there a few weeks ago.
RCIGROUP wrote:
>
> does anybody know if there is some way to have a perl script read a pdf file?
--
Get "The Perl Cookbook"
Christansen and Torkington.
O'Reilly. ISBN 1-56592-243-3
FAQ on serious steriods!
------------------------------
Date: 13 Sep 1998 16:46:48 +1000
From: dformosa@zeta.org.au (David Formosa)
Subject: Re: Perl & Java - differences and uses
Message-Id: <6tfpoo$c89$1@godzilla.zeta.org.au>
In <0OCK1.1150$E9.4125173@ptah.visi.com> George Reese <borg@imaginary.com> writes:
>In comp.lang.java.programmer David Formosa <dformosa@zeta.org.au> wrote:
>: In <LNeK1.958$E9.3226998@ptah.visi.com> George Reese <borg@imaginary.com> writes:
[...]
>: How do you get a segfualt or a memory leek from within Perl? In C
>: you just have to sneeze and you end up pointing to invalid memory.
>: But in perl there is no way due to the nature of the language to cause this
>: to occour.
>That's not the only memory issue. You also have to make sure you are
>not allocating a ton of memory and retaining references to it without
>nulling those references.
Understanable, of cause if the program is well modulazised/structured/OOized
verablies are only in scope where thay are needed and you don't have to
nullify as a natual conquence of good desine. No languge has removed the
need for good design.
[...]
>: But I don't wish to express simple idears, I wish to express quite
>: complex idears. So it seems natural that I should use a languge that
>: mirrors that complextity.
>You are not hearing me.
>Programming languages--ALL OF THEM--are simpler than spoken language.
>A programming language does not need to be complex in order to express
>complex ideas.
Of cause, however my point is that _I_ don't wish to be forced to do the
mecahical parts of the simplications. When I get hold of a algorthym
in psydocode, I wish to translate it into real code with the minimum of
semantic clutter. And country to what most peaple think perl is a very
unclutted langauge.
>:>It applies bizarre meanings to things that have very different
>:>meanings in other contexts.
>: So do natural languges. But while thay are infinitely inconsitent that
>: are what you would expect.
>What is your point here? I think you need to reread what I wrote.
My point is that natural languges are inconsitent and humans are able to
understand them. So dealing with an inconsitsy is well within a sentent
beings abilities. Perls consisten inconsitsy is quite easy to deal with.
[...]
>: Since peaple can never aggry on which is the best way to do something,
>: why should we forcably limmit them to one model or anthour?
>That is a fallacy.
Could you please explane the logical error in my question.
------------------------------
Date: 13 Sep 1998 01:31:10 GMT
From: Jeff Zucker <jeff@vpservices.com>
To: Christopher Adams <chris@opac.osl.state.or.us>
Subject: Re: Perl 5.004 upgrade problem
Message-Id: <35FB1FD1.F490BEB2@vpservices.com>
Hi Chris,
One piece of info you might provide is what platform you are on. If you
are on win32 and you do find out how to use make with gcc, let me know.
Binaries (already compiled versions of perl) are freely available so
that may be an easier route for you on any platform.
- Jeff Zucker
(fellow oregonad)
Christopher Adams wrote:
>
> I am trying to upgrade Perl 5.001 to 5.004. I have never installed
> Perl
> before. Here is what I did:
>
> rm -f config.sh
> sh Configure -Dcc=gcc
> make
> make test
> make install
>
> During 'make', I began to get some error messages, that follow:
>
> I/usr/gnu/include -I/opt/gnu/include -O
> util.c: In function `Perl_form':
> util.c:1107: number of arguments doesn't match prototype
> proto.h:125: prototype declaration
> util.c: In function `Perl_die':
> util.c:1164: number of arguments doesn't match prototype
> proto.h:70: prototype declaration
> util.c: In function `Perl_croak':
> util.c:1231: argument `pat' doesn't match prototype
> proto.h:47: prototype declaration
> util.c:1231: number of arguments doesn't match prototype
> proto.h:47: prototype declaration
> util.c: In function `Perl_warn':
> util.c:1288: number of arguments doesn't match prototype
> proto.h:529: prototype declaration
> util.c: In function `Perl_my_popen':
> util.c:1818: warning: return makes pointer from integer without a cast
> make: *** [util.o] Error 1
> <root@elmo:/usr1/oruls/perl/perl5.004_04:1710>$
>
> Since I don't have a clue what to do next, can someone point me in the
> right direction? I might need to provide more information, so please
> let
> me know what you need. Thank you.
>
> --
> Christopher Adams
> cadams@teleport.com
------------------------------
Date: Sun, 13 Sep 1998 01:54:41 GMT
From: Garry Williams <garry@america.net>
Subject: Re: Perl 5.004_04 seg fault
Message-Id: <35FB262B.B77D3984@america.net>
Jeesh! I can't make a line that big:
Result line of join would be too long
:
It runs just fine without trying to make it all one line. Why don't you
break it up?
-Garry Williams
mike wrote:
>
> The following two lines will seg fault Perl.
> Make sure the $line_buffer scalar is all on one line
> (it is probably split by my email package).
> Anybody know a workaround?
>
> Mike Kanaley
> TIBCO Inc.
>
> $line_buffer = '<a
> href=http://www.wired.com/news/news/business/story/13525.html">Brazil\'s
> Telco Samba</a></b><i><font color="#FF0000"><br> 8 Jul 1998
[snip]
> color="#FF3300" SIZE="2">Wired 4.08, Aug 1996 </font> <br> <br> <br>
> <font face="Arial, Helvetica, sans-serif" size=4>';
>
> $line_buffer =~ /^\<[^!\/]([^"\>]|"[^"]*")*\>/;
------------------------------
Date: Sun, 13 Sep 1998 03:01:30 GMT
From: lance_powers@yahoo.com
Subject: perl, NT, IIS, can't get script to use network drive
Message-Id: <6tfcia$2h8$1@nnrp1.dejanews.com>
Hi,
I have created a perl script on our NT IIS 3.0 web server that customers can
use to get a usage log of their time online. The CGI script analyzes the
RADIUS log and then emails the customer their stats for the month.
I can get it to work fine from the command line, but I cannot get it to open
the RADIUS log when it's called as a CGI. The RADIUS files are on another
computer and I have mapped a drive (k:). I'm thinking that the mapped drive
is the problem.
Here's the relevant code:
open (IN, "$filename") || warn "read_detailfile(\"$filename\"): $!\n";
If I say $filename = "detail" (and have a copy of the detail file in the
local dir it works fine).
If I say $filename = "k:\\detail" , I get the following error in the web
browser:
read_detailfile("k:\detail"):Invalid argument
It works from the command line, but not as a CGI script. Is it a lack of
permissions for IIS or have I missed something in Perl? Is there anyway to
get around this?
Thanks,
Lance
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 11 Sep 1998 16:44:33 -0400
From: lysikb@gsun208.pfizer.com (Bruce Z. Lysik)
Subject: problem with strict refs while using GIFgraph
Message-Id: <ipjiuiuxtu6.fsf@gsun208.pfizer.com>
Howdy folks. While attempting to use GIFgraph to make a neat little
chart, I've run into a problem with strict references: basically I
can't make my refs strict enough to satisfy the compiler.
Here's the error message I get while trying to run the script:
Can't use string (""/", "/usr", "/dev/fd", "/tmp", ") as an ARRAY ref
while "strict refs" in use at /usr/local/lib/perl5/site_perl/GIFgraph.pm
line 308, <FILE> chunk 3.
And even more helpful, here is the program (it's short):
use GIFgraph::bars;
open( FILE, "dfdata.log" );
my(@data);
chomp ( @data = <FILE> );
$my_graph = new GIFgraph::bars();
$my_graph->set(
x_label => 'File System Mount Point',
y_label => 'Capacity',
title => 'Disk Usage as of 9/3/98',
y_tick_number => 10,
y_label_skip => 2,
overwrite => 1,
);
$my_graph->plot_to_gif( "test.gif", \@data );
exit;
The data file is kinda messy, so I'll leave it out. Basically
it's a 3 line file. The first line contains the strings for the X
axis. The next two lines are the two sets of data.
So... any ideas? :)
Any help is appreciated.
-Bruce
eldrik@logrus.com
------------------------------
Date: Sun, 13 Sep 1998 01:36:50 -0400
From: Alex Vandiver <vandiver@tiac.net>
Subject: Sorting Arrays of Hashes..
Message-Id: <35FB59F2.3146C23F@tiac.net>
Ye perl wizards, I, the clueless neophyte, have been pounding my head
against what is probably a fairly simple/stupid mistake. Why the heck
does the following code not sort an array of hashes?
@s_data = sort {
$b->{'WHATEVER'} <=> $a->{'WHATEVER'};
} @data;
Thanks..
--
Of all the things I've lost..
..I miss my mind the most..
------------------------------
Date: 13 Sep 1998 15:37:01 +1000
From: "Brad McCready" <kaarkas@bigpond.com>
Subject: thanks for the quick responses (nt)
Message-Id: <01bdded8$dd1fe880$bee0868b@brad>
.
------------------------------
Date: Sun, 13 Sep 1998 03:17:41 GMT
From: tshinnic@io.com (Thomas L. Shinnick)
Subject: Re: Trouble with Prompt in Telnet Module
Message-Id: <35fb3862.4049653@hiram.io.com>
On Sat, 12 Sep 1998 21:16:55 GMT, Gellyfish@btinternet.com (Jonathan Stowe)
wrote:
>On 12 Sep 1998 17:45:34 GMT, Danny Aldham wrote :
>
>>X-Newsreader: TIN [version 1.2 PL2]
>>
>>I am using the Net::Telnet module to login to a NT box running the
>>telnet deamon. I am using the Input_log to see that the login process
>>_is_ working, but I am getting an error that the program is timing out
>>waiting for a command prompt. The actual prompt after logging in is:
>> C:\WINNT\system32>
>>so I think the problem is how I am putting that into the Prompt => line.
>>The complete program is below. Any help appreciated.
>>
>>
>>#!/usr/bin/perl -w
>>use Net::Telnet() ;
>>$bonham = new Net::Telnet (Host => "bonham" , timeout => 30,
>> Input_log => "/tmp/input.log" ,
>> Prompt => '/[$%C:\WINNT\system32>] $/ ' ) ;
>>$bonham -> login("administrator","password") ;
>>sleep 2 ;
>>@lines = $bonham -> cmd("ls") ;
>>print "Got @lines ";
>>$bonham -> close ;
>>
>
>My understanding was that the prompt that you supplied was the one to
>which you gave your login name and password. Not having Net::Telnet
>installed here puts me at a bit of a disadvantage though. Anyhow the
>MS telnet service is dead ropey to say the least and should be avoided
>at all costs for all but the least critical purposes - Of course you
>may be using a 3rd party telnet of which I have no opinion.
No, the prompt established by the new is the 'command' prompt, not the
login prompt, which is hard-coded:
Login prompts must match either of the patterns:
/login[: ]*$/i
/username[: ]*$/i
Password prompts must match the pattern:
/password[: ]*$/i
>
>/J\
>--
>Jonathan Stowe
>Some of your questions answered:
><URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
>
------
For all their days are full of pain, and their work is a vexation;
even at night their minds do not rest. This is also vanity.
Ecclesiastes 2:23 (King Solomon knew programmers?)
------------------------------
Date: Sat, 12 Sep 1998 22:16:18 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
To: Greg Marton <gremio@Glue.umd.edu>
Subject: Re: turning perlpod into man documentation
Message-Id: <35FB2AF2.46C50E88@erols.com>
Greg Marton wrote:
>
> 1) how do I go about making it so that I can type "man myscript" and this
> documentation would come up? (likewise, how would I go about
> distributing the script with this man documentation?)
two solutions:
1) Put it in a directory normally read by man. That is /usr/local/man.
Since it is a program, it should reside in man1 under this directory.
2) Put it in /usr/local/lib/perl5/man/man1 and hope the end users have
added that to the MANPATH variable.
> 2) how do you underline your key words, like parameters, so they stand
> out, as in other man pages?
I think that the underlining is a crude attempt for the terminal to do
italics. Use the I<> syntax around the thing you want to underline.
--
Get "The Perl Cookbook"
Christansen and Torkington.
O'Reilly. ISBN 1-56592-243-3
FAQ on serious steriods!
------------------------------
Date: Sun, 13 Sep 1998 00:15:43 -0500 (CDT)
From: MrGently@webtv.net
Subject: viewing HTML page source.
Message-Id: <8266-35FB54FF-119@newsd-164.iap.bryant.webtv.net>
How would this be done with perl ?
(I would like script to read html file and display it....like browser's
view source)
Any help would be highly appreciated
~Mika
------------------------------
Date: 13 Sep 1998 02:44:55 -0400
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: viewing HTML page source.
Message-Id: <m3emtgjyu0.fsf@poof.z.org>
MrGently@webtv.net writes:
> How would this be done with perl ?
> (I would like script to read html file and display it....like browser's
> view source)
#!/usr/bin/perl
open(HTML, "foo.html") or die "$!";
while (<HTML>) { print; }
close(HTML) or die "$!";
Jeremy
--
Jeremy D. Zawodny Web Geek, Perl Hacker, etc.
http://www.wcnet.org/~jzawodn/ jzawodn@wcnet.org
LOAD "LINUX",8,1
------------------------------
Date: Sun, 13 Sep 1998 06:42:09 GMT
From: kevinslew@my-dejanews.com
Subject: Why does this sort work in Dos but not in Unix?
Message-Id: <6tfpg1$ecf$1@nnrp1.dejanews.com>
I'm trying to sort an array of hashes. It runs fine as a dos script but
doesn't change anything when running as a cgi on unix. Can anyone help?
$results[0]{rank}=50;
$results[0]{name}="Uncle";
$results[1]{rank}=70;
$results[1]{name}="Aunt";
$results[2]{rank}=30;
$results[2]{name}="Brother";
print "Before\n";
for $i (0..$#results) {
print "$results[$i]{rank} $results[$i]{name}\n";
}
@newlist = sort {$a{rank} <=> $b{rank}} @results;
print "After\n";
for $i (0..$#newlist) {
print "$newlist[$i]{rank} $newlist[$i]{name}\n";
}
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3703
**************************************