[10635] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4227 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 16 04:07:15 1998

Date: Mon, 16 Nov 98 01:00:19 -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, 16 Nov 1998     Volume: 8 Number: 4227

Today's topics:
        ! Help with an EASY question <Jason@InsideMedicine.com>
    Re: ! Help with an EASY question (Ronald J Kimball)
    Re: ! Help with an EASY question (Larry Rosler)
    Re: another pod Q (was Re: Q: pod inside data structure (Matthew Bafford)
    Re: another pod Q (was Re: Q: pod inside data structure (Ilya Zakharevich)
    Re: another pod Q (was Re: Q: pod inside data structure <uri@sysarch.com>
    Re: another pod Q (was Re: Q: pod inside data structure <uri@sysarch.com>
    Re: changing formvalues <spamless-perth@flash.net>
    Re: Command line globbing and Windows 95 (Martin Vorlaender)
    Re: compiling modules under Win95 problems <Savage.Ron.RS@bhp.com.au>
    Re: Easy question? <ben@smartservers.com>
        Form value security & sendmail <aaron_deleteme@cir.nus.edu.sg>
        FRESHMAN:preview of form data, adding files etc. <gss2@roogna.eng.wayne.edu>
    Re: Help reading binary file (Martien Verbruggen)
        manipulating dates <eodekirk@inprise.com>
    Re: manipulating dates (Sean McAfee)
    Re: Newbie: File creation problem. (Peter J. Kernan)
    Re: Perl for web programming <freddy@attrition.com>
    Re: Perl vs C (Ethan H. Poole)
        Perl_for_Win32_FAQ <hetrick@acm.org>
    Re: Q: are symbolic refs really needed (was Re: Modific <zenin@bawdycaste.org>
        Shared Variable <jean-michel.houmard@bakom.admin.ch>
    Re: Why does this give a warning! (Martien Verbruggen)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 15 Nov 1998 22:45:13 -0600
From: "Jason Hatcher" <Jason@InsideMedicine.com>
Subject: ! Help with an EASY question
Message-Id: <72oaib$jus@enews1.newsguy.com>

I am embarrassed to even ask this ...... I am needing a SIMPLE routine to
produce a random text string of a certain length ..... I know I can do this
with a random number and then some manipulation to ASCII, but that seems
inefficient ....... is there a better solution??

Thanks, Jason




------------------------------

Date: Mon, 16 Nov 1998 01:01:40 -0500
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: ! Help with an EASY question
Message-Id: <1dikanj.1ytpzxn1dz9j3N@bay1-378.quincy.ziplink.net>

Jason Hatcher <Jason@InsideMedicine.com> wrote:

> I am embarrassed to even ask this ...... I am needing a SIMPLE routine to
> produce a random text string of a certain length ..... I know I can do this
> with a random number and then some manipulation to ASCII, but that seems
> inefficient ....... is there a better solution??

I might do it like this:

@chars = ('A' .. 'Z', 'a' .. 'z', 0 .. 9);

$str = '';
$len = 4;

$str .= $chars[rand @chars]
  while (length $str < $len);

-- 
 _ / '  _      /         - 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: Sun, 15 Nov 1998 23:58:09 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: ! Help with an EASY question
Message-Id: <MPG.10b97aea6a3cfd9098990e@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <72oaib$jus@enews1.newsguy.com> on Sun, 15 Nov 1998 22:45:13 
-0600, Jason Hatcher <Jason@InsideMedicine.com> says...
> I am embarrassed to even ask this ...... I am needing a SIMPLE routine to
> produce a random text string of a certain length ..... I know I can do this
> with a random number and then some manipulation to ASCII, but that seems
> inefficient ....... is there a better solution??

I posted this in September, 
<URL:http://x4.dejanews.com/getdoc.xp?AN=387183798>

sub Rand {     # string = Rand(number_of_characters)
    my @chars = ('A' .. 'Z', 'a' .. 'z', '0' .. '9');
    join "" => @chars[ map rand @chars => 1 .. shift ]
}

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: Sun, 15 Nov 1998 22:26:35 -0500
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: another pod Q (was Re: Q: pod inside data structures)
Message-Id: <MPG.10b965772f62de7f989714@news.scescape.net>

In article <x7vhkh5v3o.fsf_-_@sysarch.com>, Uri Guttman <uri@sysarch.com> 
pounded in the following:
=> i have another pod and data question. i think this is impossible but an
=> interesting idea. i want to have a single usage text be in both a perl
=> string AND pod text in the same file. you can see the advantage here of
=> maintaining only one usage text and having it print from perl and in the
=> pod2xxx output.
=> 
=> any possibilities? i doubt it since perl and pod parsing are mutually
=> exclusive from what i gather.

Would something like:

#!/usr/bin/perl -w

my $usage = <<"=cut";
=pod

=head1 USAGE

BLAH BLAH BLAH

=cut

print $usage;

__END__

work?

Of course, you'd have to remove the first 4 and the last 1 lines...  It 
ain't purty, but pod2html parses it ok. :)

=> uri

--Mathew


------------------------------

Date: 16 Nov 1998 05:29:48 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: another pod Q (was Re: Q: pod inside data structures)
Message-Id: <72od8c$ck2$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Uri Guttman 
<uri@sysarch.com>],
who wrote in article <x7vhkh5v3o.fsf_-_@sysarch.com>:
> i have another pod and data question. i think this is impossible but an
> interesting idea. i want to have a single usage text be in both a perl
> string AND pod text in the same file. you can see the advantage here of
> maintaining only one usage text and having it print from perl and in the
> pod2xxx output.
> 
> any possibilities? i doubt it since perl and pod parsing are mutually
> exclusive from what i gather.

My pfind script (which see ;-) does effectively 

   @ARGV or exec 'perldoc', '-F', $0;

(plus special-casing of $] < 5.005, where perldoc would not guess what
-F should mean).

Ilya


------------------------------

Date: 16 Nov 1998 01:02:44 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: another pod Q (was Re: Q: pod inside data structures)
Message-Id: <x73e7k5g57.fsf@sysarch.com>

>>>>> "IZ" == Ilya Zakharevich <ilya@math.ohio-state.edu> writes:


  IZ>    @ARGV or exec 'perldoc', '-F', $0;

  IZ> (plus special-casing of $] < 5.005, where perldoc would not guess what
  IZ> -F should mean).

this looks like it would print all the pod from a script. i only want
the usage section. i got 2 other replies, one of which works directly by
overlapping a here doc with a pod section by using =cut as the here doc
marker. very cute and it does work! also i was told of a module which
does this which i will explore.

uri


-- 
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: 16 Nov 1998 00:49:47 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: another pod Q (was Re: Q: pod inside data structures)
Message-Id: <x790hc5gqs.fsf@sysarch.com>

>>>>> "MB" == Matthew Bafford <dragons@scescape.net> writes:


  MB> Would something like:

  MB> #!/usr/bin/perl -w

  MB> my $usage = <<"=cut";
  MB> =pod

  MB> =head1 USAGE

  MB> BLAH BLAH BLAH

  MB> =cut

  MB> print $usage;

looks interesting and i will try it. 

uri

-- 
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: Mon, 16 Nov 1998 00:32:39 -0600
From: Perth <spamless-perth@flash.net>
Subject: Re: changing formvalues
Message-Id: <364FC707.C0BB9FF0@flash.net>

use a client side language (javascript) for that stuff.

~perth~

Geoffrey Hebert wrote:
> 
> No.
> 
> Casema wrote:
> 
> > Can man dynamically change values from <INPUT TYPE="TEXT"> from a Perl
> > script?
> > Like pressing a button would search my database and pass the found content
> > into a textbox, so I do not have to push a new form to the browser?
> >
> > Michel


------------------------------

Date: Mon, 16 Nov 1998 06:33:29 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Command line globbing and Windows 95
Message-Id: <364fb929.524144494f47414741@radiogaga.harz.de>

Chris Crook (chris@zucchini.linz.govt.nz) wrote:
: I have a problem with ActivePerl (versions 502, 504, 506, it doesn't matter
: which) and file globbing under Windows 95.  Wild card filenames on the
: command line aren't being expanded.  That is, if I enter something like
:
:    perl -e "print join(' ',@ARGV);" *.*
:
: Then all that gets printed is "*.*", not a list of file names.  I'm sure
: that this used to work with at least one of these versions of perl.  This
: occurs on several different PCs.  I believe that the program perlglob.exe
: is used for file name expansion, and the program itself certainly works ok
: (ie perlglob *.* prints a list of file names).  Also the glob command works
: fine.  I have seen work arounds with running modules using the -M option to
: expand @ARGV.  

That's the way to go under WinDoze. I think the following is by
Gurusamy Sarathy, but have lost reference.

cu,
  Martin

=pod

=head2 Why won't my perl understand wildcards in arguments?

The default command shells on DOS descendant operating systems (such
as they are) usually do not expand wildcard arguments supplied to
programs.  They consider it the application's job to handle that.
This is commonly achieved by linking the application (in our case,
perl) with startup code that the C runtime libraries usually provide.
However, doing that results in incompatible perl versions (since the
behavior of the argv expansion code differs depending on the
compiler, and it is even buggy on some compilers).  Besides, it may
be a source of frustration if you use such a perl binary with an
alternate shell that *does* expand wildcards.

Instead, the following solution works rather well. The nice things
about it: 1) you can start using it right away 2) it is more powerful,
because it will do the right thing with a pattern like */*/*.c
3) you can decide whether you do/don't want to use it 4) you can
extend the method to add any customizations (or even entirely
different kinds of wildcard expansion).

	C:\> copy con c:\perl\lib\Wild.pm

=cut

	# Wild.pm - emulate shell @ARGV expansion on shells that don't
	use File::DosGlob 'glob';
	@ARGV = map {
		      my @g = File::DosGlob::glob($_) if /[*?]/;
		      @g ? @g : $_;
		    } @ARGV;
	1;

=pod
	^Z
	C:\> set PERL5OPT=-MWild
	C:\> perl -le "for (@ARGV) { print }" */*/perl*.c
	p4view/perl/perl.c
	p4view/perl/perlio.c
	p4view/perl/perly.c
	perl5.004_02/win32/perlglob.c
	perl5.004_02/win32/perllib.c
	perl5.004_03/win32/perlglob.c
	perl5.004_03/win32/perllib.c
	perl5.004_531/win32/perlglob.c
	perl5.004_531/win32/perllib.c

Note there are two distinct steps there: 1) You'll have to create
Wild.pm and put it in your perl lib directory. 2) You'll need to
set the PERL5OPT environment variable.  If you want argv expansion
to be the default, just set PERL5OPT in your default startup
environment.

--
                        | Martin Vorlaender | VMS & WNT programmer
 VMS is today what      | work: mv@pdv-systeme.de
 Microsoft wants        |       http://www.pdv-systeme.de/users/martinv/
 Windows NT 8.0 to be!  | home: martin@radiogaga.harz.de


------------------------------

Date: Mon, 16 Nov 1998 14:53:13 +1100
From: "Ron Savage" <Savage.Ron.RS@bhp.com.au>
Subject: Re: compiling modules under Win95 problems
Message-Id: <72o774$o1924@atbhp.corpmel.bhp.com.au>

I just tried installing Term-Size-0_2.tar.gz under DOS (aka Windows 95).
Unfortunately it uses a Unix-only file 'sys/termios.h', so I really don't
see how you can do it...

Which other modules did you get errors with?
--
Ron Savage
Home (preferred): rpsavage@ozemail.com.au
Office: Savage.Ron.RS@bhp.com.au
http://www.ozemail.com.au/~rpsavage
Michael Haertfelder wrote in message <74pUTB7FZZB@wharp.rhein-main.de>...
[snip]
>Writing Makefile for Term::Size
[snip]





------------------------------

Date: Sun, 15 Nov 1998 23:11:23 -0400
From: Ben Duncan <ben@smartservers.com>
Subject: Re: Easy question?
Message-Id: <364F97DB.254CBB3E@smartservers.com>

Hiya,

> > while (my @row = $sth->fetchrow) {
> > ($user,$email,$title,$os,$product) = @row;
> > push(@usermail,$email);
> > push(@productname,$product) if($product ???????? @productname);
> 
> $products{$product}++; # or something else.

Alright! It works great.

if(!$productname{$product} && $product ne "") {
push(@productname,$product);
$productname{$product}++;
}

Volia :) Thanks for the help!

- Ben


------------------------------

Date: Mon, 16 Nov 1998 10:34:54 +0800
From: Aaron <aaron_deleteme@cir.nus.edu.sg>
Subject: Form value security & sendmail
Message-Id: <364F8F4E.A21C5278@cir.nus.edu.sg>

Hi! I'm trying to use some values obtained from a form and to mail them
using sendmail. I'm worried about the metacharacters and would like to
filter the values first before sending them out. Is mail::sendmail the
proper Perl module to address this problem? and does it cover the
security portion? Thanks in advance.

Aaron



------------------------------

Date: Sun, 15 Nov 1998 23:34:10 -0500
From: shienh gurpreet <gss2@roogna.eng.wayne.edu>
Subject: FRESHMAN:preview of form data, adding files etc.
Message-Id: <364FAB42.228EFCB@roogna.eng.wayne.edu>

Thanks to everybody who've been helping me with my question on PERL.
    I have written a script ( not very sophisticated one, it being my
second script). It reads in the data from a form (which includes the
user giving a file name). If that file (web page) exists, it gives the
user an error message otherwise it goes on to create that file using
form data. Also, once it creates that file, it adds a link pointing to
that file on a page chosen by the user (just like a free for all links
page, except that instead of adding links to the same page, it adds
links to different pages).
    My problem is that if the user fills in any info incorrectly (eg.
wrong name of an image file), even then the file is created with wrong
info. I wish if I could show a preview of the page to the user before
actually creating the webpage and adding link pointing to it, so that he
can choose if he wants to create the page or make any changes.
Also, it sounds very stupid though, but I have to chmod all my
dirctories, to which pages could be added, to 0777, otherwise it won't
add files to them.
Suggestions please. Pardon me if my posts are too lengthy, but I want to
provide complete info. Thank you.



------------------------------

Date: Mon, 16 Nov 1998 03:15:30 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Help reading binary file
Message-Id: <mNM32.83$cl1.159@nsw.nnrp.telstra.net>

In article <364F84DA.51E8260C@americasm01.nt.com>,
	Patrick Amaku <pamaku@americasm01.nt.com> writes:
> Hi,
> 
> How do i get a substring from a buffer containing binary data?
> When a execute the lines below i get 55 rather than 78. What am i
> doing wrong? Any idea where i can find sample scripts that process
> binary data
> 
> $SIZE_WORD=4;
> read(FH,$buffer,2048)
> $buffer=0x004e;                        # just initialize buffer to a
> know value (78 decimal)
> $word1 = unpack("C*",substr($buffer,0,$SIZE_WORD));
> print $word1, "\n";

The above code doesn't compile. You're missing a semi-colon.

You set $buffer to 0x004e. Then you treat it as a string, with substr.
The result is:

"78"

Then you proceed to unpack it as a character. That means that you
unpack '7', which will give you the number 55.

If you set $buffer to 'N', you'll get your 78 back.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | If at first you don't succeed, try
Commercial Dynamics Pty. Ltd.       | again. Then quit; there's no use being
NSW, Australia                      | a damn fool about it.


------------------------------

Date: Sun, 15 Nov 1998 20:10:01 -0800
From: Esther Odekirk <eodekirk@inprise.com>
Subject: manipulating dates
Message-Id: <364FA599.361FE77E@inprise.com>

How does one go about manipulating dates?  For example, I would like to
read in the current date/time and subtract 24 hours from it ensuring
that possible changes in the month and year as well as time changes and
leap year are taken into consideration.  Is there a way I can do this?

Thank you for your help!
Esther


------------------------------

Date: Mon, 16 Nov 1998 05:35:47 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: manipulating dates
Message-Id: <TQO32.73$CY1.447289@news.itd.umich.edu>

In article <364FA599.361FE77E@inprise.com>,
Esther Odekirk  <eodekirk@inprise.com> wrote:
>How does one go about manipulating dates?  For example, I would like to
>read in the current date/time and subtract 24 hours from it ensuring
>that possible changes in the month and year as well as time changes and
>leap year are taken into consideration.  Is there a way I can do this?

Download the Date::Manip module from CPAN.

-- 
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
            | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
            | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu


------------------------------

Date: 16 Nov 1998 05:45:17 GMT
From: pete@localhost.localdomain (Peter J. Kernan)
Subject: Re: Newbie: File creation problem.
Message-Id: <72oe5d$g0o$1@pale-rider.INS.CWRU.Edu>

In article <364F2084.365E0562@hotmail.com>,
	"Christian H. Knudsen" <chrknudsen@hotmail.com> writes:
> I've made a short routine to check if a file exists, then
> create it if not. Doesn't work. I don't get an error, it
> just doesn't create the file.
> 
> Here's the code:
> 
> 
> ### CODE START ###
> 
> $ip = $ENV{'REMOTE_ADDR'};
> $cart = "/data1/hypermart.net/bluegalaxy/carts/$ip";
[...snip...]
> By the way, the /carts directory is chmod to 766, in case you

766 is a very strange permission. you probably want your "carts" dir
to be executable as well (777 -- but this a dangerously
promiscuous mod, will 775 do?), if a dir is not executable it cannot 
be cd'd to. If you cannot cd to a dir you cannot create a file in it 
(as far as I know). I cannot think of any reason for a 766 permission, 
seems morally equivalent to 700 to me.
-- 
open SIG, "<$ENV{HOME}/.sig"         or die       "sigless!     $!"; 
$sig = do {local $/; <SIG>};         close SIG && print<<"$sig SIG";
        Pete Kernan  CWRU Physics and Statistics Depts
        http://theory2.phys.cwru.edu/~pete
$sig SIG


------------------------------

Date: Sun, 15 Nov 1998 22:38:22 -0600
From: "Alfredo LopezJr." <freddy@attrition.com>
Subject: Re: Perl for web programming
Message-Id: <364FAC3E.33B2EEC9@attrition.com>

Thanks Brian.. I checked it out.. seems to be what I was looking for. :^)

Regards,

-Alfredo

AlfredoLopez
Express-News New Media Design



------------------------------

Date: Mon, 16 Nov 1998 05:58:03 GMT
From: ehpoole@ingress.com (Ethan H. Poole)
Subject: Re: Perl vs C
Message-Id: <L9P32.35$u93.87@news13.ispnews.com>

In article <911182145.674251@elaine.drink.com>, gorilla@elaine.drink.com 
says...
>
>In article <364f7733.0@newsread1.dircon.co.uk>,
>Paul Davies <cobalt@dircon.co.uk> wrote:
>>Hi There
>>
>>Can anyone give me some information as to the relative speeds of perl and C
>>programs?
>
>Perl programs are faster than C programs in someways, and slower than C
>programs in other ways. Without specific questions, it's impossible to
>say any more than that.

For a much more *general* assessment:

Perl will usually smoke C in terms of development time.

C will nearly always (exceptions?) smoke Perl in terms of execution speed.

-- 
Ethan H. Poole              | Website Design and Hosting,
                            | CGI Programming (Perl & C)..
========Personal=========== | ============================
* ehpoole @ ingress . com * | --Interact2Day--
                            | http://www.interact2day.com/



------------------------------

Date: Sun, 15 Nov 1998 23:48:12 -0500
From: "George C. Hetrick" <hetrick@acm.org>
Subject: Perl_for_Win32_FAQ
Message-Id: <F6O32.426$5O6.494820@lwnws01.ne.mediaone.net>

Can anyone tell me where Perl_for_Win32_FAQ.html has gone to?
The link on www.perl.org is a dead link, and so are all the other
copies I've checked (even including one on www.dnttm.ro, which is what Cetus
directs me to).

I'm trying to embed perl in an application under MS VC++6.




------------------------------

Date: 16 Nov 1998 08:34:23 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Q: are symbolic refs really needed (was Re: Modification of a read-only??)
Message-Id: <911205143.495358@thrush.omix.com>

Uri Guttman <uri@sysarch.com> wrote:
: >>>>> "Z" == Zenin  <zenin@bawdycaste.org> writes:
	>snip<
:   Z> 	Yes, we do.  Mainly for safer black magic, but we do need them.
: if so, why not make the default strict refs, like i proposed. if you
: know how to hack symbol table black magic you know enough to enable
: them. the newbies who think that softrefs are the way to build data
: structures by name instead of hashes (and HoH) are the problem.

	"Reverse compatibility"

	You'll learn to loath those words...

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


------------------------------

Date: Mon, 16 Nov 1998 09:47:33 +0100
From: Jean-Michel Houmard <jean-michel.houmard@bakom.admin.ch>
Subject: Shared Variable
Message-Id: <364FE6A5.F2B3BC56@bakom.admin.ch>

Hi,
    I get the following message when I start my perl script:

Variable "$vVar" will not stay shared at /tmp/jmh.pl line 8.
Test

Any Idea why and how can I work with $vVar in subroutines without error
message?

Regards

Jean-Michel

PS: the script:

#!/usr/bin/perl -w
#
sub F1
{
  my $vVar="Test";
  sub F2
  {
    print "$vVar\n";
  }
  F2;
}
F1;
# -- End file

--
 Jean-Michel.Houmard@bakom.admin.ch
 BAKOM/OFCOM - Bienne - Switzerland
 Voice: +41-32-327 54 62  Fax: +41-32-327 55 55




------------------------------

Date: Mon, 16 Nov 1998 03:06:08 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Why does this give a warning!
Message-Id: <AEM32.79$cl1.159@nsw.nnrp.telstra.net>

In article <364F8081.61B9BB4F@unicomp.net>,
	Eric Molitor <spamsucks@unicomp.net> writes:

>       # Why does the following line give the error
>       # Use of uninitialized value at line ..., <NETSTAT> chunk2.
>       if ((split(/:/,(split(/ +/))[3]))[1] eq "110") {
>          $count+=1;
>       }

Probably because (split(/:/, (split(/ +))[3]))[1] is undefined, or
because (split(/ +))[3] is undefined.

Either you don't have 4 space separated fields in $_ or you don't have
a colon in (split(/ +))[3]. Try assigning these things bit by bit to
some variables. Print out the variables. See what they contain.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | 
Commercial Dynamics Pty. Ltd.       | What's another word for Thesaurus?
NSW, Australia                      | 


------------------------------

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 4227
**************************************

home help back first fref pref prev next nref lref last post