[9956] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3549 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 26 11:03:38 1998

Date: Wed, 26 Aug 98 08:00:18 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 26 Aug 1998     Volume: 8 Number: 3549

Today's topics:
        Ann: CGI/Perl Class, Phila Area, Sep 29-Oct 2 <joseph@5sigma.com>
    Re: chop bug rockwell@shr.dec.com
    Re: Cisco router telnet program (Ivo Almeida)
    Re: Code Style (Was: How to sort this associative array (Kevin Reid)
    Re: Data::Dumper question <jdporter@min.net>
    Re: eval() and Subroutines (Kevin Reid)
    Re: Help with reading a file <NOTHANKStbeaulieu@mediaone.net>
    Re: Help with reading a file (Larry Rosler)
    Re: how can I print 10 digit nos. using 0s as place hol <jdporter@min.net>
        How to match anything but some characters (reg-exp) <hauk@forumnett.no>
    Re: How to match anything but some characters (reg-exp) (Mike Stok)
    Re: How to match anything but some characters (reg-exp) (Bob Trieger)
    Re: How to match anything but some characters (reg-exp) <nguyend7@msu.edu>
    Re: man pages for win32 perl <nguyend7@msu.edu>
    Re: Perl compiler <jdporter@min.net>
    Re: Perl compiler <jdporter@min.net>
    Re: Posting JPEG-images from CGI-script... <9401962_@ml.petech.ac.za>
        RE Losing digits on numbers with magic increment <9401962_@ml.petech.ac.za>
    Re: RE Losing digits on numbers with magic increment <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: Regex question - removing HTML tags.... (Tad McClellan)
    Re: webcounter in Perl? (I R A Aggie)
    Re: Y2K Date Support <jdporter@min.net>
    Re: Y2K Date Support (Bob Trieger)
    Re: Yes, someone else in need of PERL help (Tad McClellan)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Wed, 26 Aug 1998 07:41:52 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Ann: CGI/Perl Class, Phila Area, Sep 29-Oct 2
Message-Id: <35E41E9D.520094BB@5sigma.com>

5 Sigma Productions will be presenting a 4-day "Learning CGI with
Perl" class in Moorestown, NJ from Tuesday, September 29 through
Friday, October 2.  Joseph Hall, author of Effective Perl Programming,
will be teaching the class.

A one-day "Perl refresher" will be taught on Monday, September 28
for students in the CGI class who want to brush up on regular
expressions and other Perl topics that will be important in
completing the work in the CGI class.  It won't substitute for
a thorough introduction to Perl, but students whose Perl is a
little rusty are advised to take it.

The class will be taught at the GORCA training facility in
Moorestown, NJ, using Solaris 2.6 and Apache.

Prequisites for the class are: recent programming experience, a
basic understanding of Perl, and some user experience with Unix.
Familiarity with a Unix text editor like vi or emacs will be helpful,
although there will be workarounds for the less unix literate.
The course involves a fair bit of programming, so students with
little or no recent Perl experience are strongly advised to take 
an introductory Perl course first.

For more information (including pricing), see:

  http://www.perltraining.com/schedules.html

	-joseph


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

Date: Wed, 26 Aug 1998 14:04:49 GMT
From: rockwell@shr.dec.com
Subject: Re: chop bug
Message-Id: <6s14m0$775$1@nnrp1.dejanews.com>

Problem solved and novice perl programmer enlightened....
Many thanks to all who replied....I don't get here much because
our firewall doesn't pass news but can access via web thru dejanews

what a great community...thanks

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Wed, 26 Aug 1998 15:42:10 +0100
From: ivo.almeida@bta.pt (Ivo Almeida)
Subject: Re: Cisco router telnet program
Message-Id: <MPG.104e2f1ac76aacc6989684@news.telepac.pt>

In article <MPG.104dfa63a519d40d989683@news.telepac.pt>, 
ivo.almeida@bta.pt says...
> 	foreach (@exec) {  
> 		$_ .= "\n";
> 		print and print $htp $_; 
> 		($match, $err, $before) = expect ($htp, $timeout, $PS1);
> 		print substr ($before, 1 + length) . $match;
> 	}
> 
>

Ops, I have a little (?) bug here!
Please subst the code above by
-----------
	foreach (@exec) {  
		print and print $htp $_; 
		($match, $err, $before) = expect ($htp, $timeout, $PS1);
		print substr ($before, 1 + length) . $match;
	}
-----------

Sorry for the problem!

Ivo Almeida


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

Date: Wed, 26 Aug 1998 10:32:59 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Code Style (Was: How to sort this associative array?)
Message-Id: <1dea375.mil6jbs17a26N@slip166-72-108-25.ny.us.ibm.net>

Just thought I'd list some of my formatting styles:

my $self = bless {
  param => 'value',
  p2 => $input,
}, $class;

for ($i = 0; $i < maxval(); $i++) {
  code;
}

if (
  cond1 and
  cond2 and
  cond3
) {
  code;
}

if (shortcond) {one statement}

open IN, $file or die "open failed: $!";

$win->sethook("hit", sub {
  my ($self, $window) = @_;
  code;
});

a('very ' x 3, long(), function(), 'call that may fail')
  or die; 

-- 
  Kevin Reid.      |         Macintosh.
   "I'm me."       |      Think different.


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

Date: Wed, 26 Aug 1998 10:40:40 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Data::Dumper question
Message-Id: <35E41E68.7DF8@min.net>

Niels Larsen wrote:
> 
>   use Data::Dumper;
>   $hashRef = { "hello" => "world" };
>   $struct->{$hashRef} = 1;
>   print Data::Dumper->Dump ([$struct]), "\n";
> 
> produces
> 
>   $VAR1 = {
>             'HASH(0x80b78d0)' => 1
>   };
> 
> Maybe a total dummy question, but should the output not show
> the hash reference expanded?

It did exactly what you asked it to do.

When you say
	$struct->{$hashRef} = 1;
the value of $hashRef gets stringized for use as a hash key,
which in this case was 'HASH(0x80b78d0)'.  So equiv:
	$struct->{'HASH(0x80b78d0)'} = 1;
Of course, now $struct is a ref to an anonymous hash.
That's what Data::Dumper dumped.

-- 
John Porter


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

Date: Wed, 26 Aug 1998 10:33:02 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: eval() and Subroutines
Message-Id: <1dea76k.1tu00x31rv9kg0N@slip166-72-108-25.ny.us.ibm.net>

Mooneer Salem <mooneer@earthlink.net> wrote:

> In perl, if i use an eval() block and I call subroutines defined outside
> the block, will it result in any errors?
> 
> For example:
> 
> sub div {
>     my ($n1, $n2) = @_;
> 
>     if ($n2 == 0) {
>         die "Division by zero\n";
>     } else {
>         return $n1 / $n2;
>     }
> }
> 
> eval{
>   &div;
> }

No, but couldn't you have just tried it?

-- 
  Kevin Reid.      |         Macintosh.
   "I'm me."       |      Think different.


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

Date: Wed, 26 Aug 1998 10:33:01 -0400
From: "Todd B" <NOTHANKStbeaulieu@mediaone.net>
Subject: Re: Help with reading a file
Message-Id: <6s16d3$8p0$1@wbnws01.ne.highway1.com>

if there's no such thing as a line, why does your example code demonstrate
reading lines in a variable called "nextline"?<g>



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

Date: Wed, 26 Aug 1998 07:28:09 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Help with reading a file
Message-Id: <MPG.104dbb573a831929897f0@nntp.hpl.hp.com>

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

In article <pvdnq0k5.fsf@mailhost.panix.com> on 26 Aug 1998 09:28:58 -
0500, Jonathan Feinberg <jdf@pobox.com> says...
 ...
> > Also, is there a limit on the maximum number of characters that can
> > be written on a single line into a text file? 256?
> 
> The size limit of a line is given by the unix command 'df'.

On my Unix system (HP-UX, of course), this is 'df':

 df - report number of free disk blocks

and its man page reports conformity with several OS standards.

A quick web search for 'man df' yields this:

man df. NAME. df - summarize free disk space.

Is there a relationship between this 'df' and the command 'df' you have?

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


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

Date: Wed, 26 Aug 1998 10:51:22 -0400
From: John Porter <jdporter@min.net>
Subject: Re: how can I print 10 digit nos. using 0s as place holders
Message-Id: <35E420EA.6A50@min.net>

Mike Hammernik wrote:
> 
> I'm trying to create file that contain a 10 digit string. The first 6
> digits are given by the user. I then need to count but I need to keep
> the number in the 10 digit format. For example
> If given 111222 I now need to construct a file that contains
> 
> 1112220001
> 1112220002
> .
> .
> 1112229999

do_it( '111222' );

sub do_it {
  local $, = "\n";
  my $n = 10000 * shift;
  print $n+1 .. $n+9999, '';
}

-- 
John Porter


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

Date: Wed, 26 Aug 1998 16:07:33 +0200
From: Hauk Langlo <hauk@forumnett.no>
Subject: How to match anything but some characters (reg-exp)
Message-Id: <35E416A5.9361608A@forumnett.no>

Hi there and sorry for bothering you with this.

I'm about to check if the content of a string contains anything else
than normal letters digits or one of these "---" I could ofcourse look
for anything else by defining all other normal characters likely to
appear ( _ / & ! @ " # etc), but that would not make me feel good about
myselfe. I would be very happy if someone knew how to write a reg exp
that works like this:

If ($somescalar =~ /"anything exept a-z, 0-9, or -"/g){
            do stuff
}


I know that this problem probably is of a basic structure for the
experts out there. I really have tried figuring this out by reading the
MAN pages and the exellent Lama and Camel books, but as a newbie it has
been to no avail. I'm thankfull for any response.

Regards
Hauk Langlo

--

----------------------------------
 Hauk Langlo

 Hauk@forumnett.no
 http://www.forumnett.no/~hauk
 (+047) 93438940
----------------------------------




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

Date: 26 Aug 1998 14:38:13 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: How to match anything but some characters (reg-exp)
Message-Id: <6s16kl$ek1@news-central.tiac.net>

In article <35E416A5.9361608A@forumnett.no>,
Hauk Langlo  <hauk@forumnett.no> wrote:
>Hi there and sorry for bothering you with this.
>
>I'm about to check if the content of a string contains anything else
>than normal letters digits or one of these "---" I could ofcourse look
>for anything else by defining all other normal characters likely to
>appear ( _ / & ! @ " # etc), but that would not make me feel good about
>myselfe. I would be very happy if someone knew how to write a reg exp
>that works like this:
>
>If ($somescalar =~ /"anything exept a-z, 0-9, or -"/g){
>            do stuff
>}

I'm not quire sure what you mean, but

  if ($somescalar =~ /[^a-z0-9-]/) {
    # get here if $somescalar contains an "illegal" character
  }

uses a negated character class to say "anything except a-z 0-9 or -", this
needs at least one illegal character to match,

  unless ($somescalar =~ /^[a-z0-9-]+$/) {
    # get here unless $somescalar isn't just made of one or more 
    # legal characters
  }

will require $somescalar to have at least one character and for all of its
characters to be legal (except, possibly, a trailing \n).  Here ^ and $
are anchors (also known as zero width assertions) which are documented in
the perlre man page.

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: Wed, 26 Aug 1998 14:32:14 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: How to match anything but some characters (reg-exp)
Message-Id: <6s16fi$des$1@ligarius.ultra.net>

[ posted and mailed ]

Hauk Langlo <hauk@forumnett.no> wrote:

-> If ($somescalar =~ /"anything exept a-z, 0-9, or -"/g){
->             do stuff
-> }
-> 

if ($var !~ /^[a-zA-Z0-9-\s]$/) {do stuff }
        or
if ($var =~ /[all the characters you want to match]/) { do stuff }

Regular expressions and character classes begin on page 26 in the blue camel 
but they are discussed more in the Llama which unfortunately I don't have with 
me at the moment.


There is one more book that you may want to add to your library, `Mastering 
Regular Expressions' by Jeffrey E. F. Freidl and published by O'Reilly.

HTH

Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-400-1972 
  Ext: 1949 and let the jerk that answers know 
  that his toll free number was sent as spam. "


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

Date: 26 Aug 1998 14:50:34 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: How to match anything but some characters (reg-exp)
Message-Id: <6s17bq$e65$2@msunews.cl.msu.edu>

Hauk Langlo <hauk@forumnett.no> wrote:
Try reading the man page on regex's call perlre
and perlfaq6

: If ($somescalar =~ /"anything exept a-z, 0-9, or -"/g){
:             do stuff
: }

[^a-z0-9\-]  //that's all I'm giving you.

: I know that this problem probably is of a basic structure for the
: experts out there. I really have tried figuring this out by reading the
: MAN pages and the exellent Lama and Camel books, but as a newbie it has
: been to no avail. I'm thankfull for any response.

So read them again.  They're great reading material.

-dan
-- 
           Dan Nguyen            | There is only one happiness in
        nguyend7@msu.edu         |   life, to love and be loved.
http://www.cse.msu.edu/~nguyend7 |                   -George Sand



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

Date: 26 Aug 1998 14:40:36 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: man pages for win32 perl
Message-Id: <6s16p4$e65$1@msunews.cl.msu.edu>

Daniel or Shelly <wedeking@msw0.attnet.or.jp> wrote:
: Where are the man pages for win32 perl?
Are you using the ActiveWare port?  If  you are it's in
C:\PERL\DOC\PERL.  They are all in HTML format.

: Why doesn't it work
: when I want to look up a perl command with the man pages
: on my windows 98 computer and I type "man (perl command"
: after the "C:\perl\" prompt?

First of all your using billware.  There isn't a man utility built
into windows.  Remember that Perl is developed by unix people for
unix machines.  In unix man pages allow easy access to the manual for
each utility and application.  It actually tells us what all the
command line options are.

Your idea of "man" is wrong.  'man print' will not do anything (I'm
wrong I get the manpage of the shell's print).  You don't get what
anything about perl's print.  'man perltoot' will get your Tom's oo
tutorial.  I'm not sure if Windows people have perldoc.  But 'perldoc
-f print' is the correct way of looking it up.

-dan
-- 
           Dan Nguyen            | Linux.  Linux. Linux. Linux. Linux.
        nguyend7@msu.edu         |     Did I say Linux?  Get it!
http://www.cse.msu.edu/~nguyend7 |       http://www.linux.org



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

Date: Wed, 26 Aug 1998 10:22:22 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl compiler
Message-Id: <35E41A1E.76F0@min.net>

John Stanley wrote:
> 
> All security is via obscurity, as I have been told by someone
> who claims to know such things.

Hmmm.  Given that we're talking about "soft" security --
waving a hardware key in the enemy's face doesn't 
compromise it -- then this generalizes "obscurity" to the
point of meaninglessness.  The effectiveness of passwords
and codepads depends on their not being revealed.
But apart from passwords/codepads, obscurity is too hard
to achieve to be reliable.  Indeed, one must assume that
the algorithms are known to all.  In this sense,
security comes via difficulty, e.g. a very computationally
hard problem, to which the key(s) provide a partial
solution.

-- 
John Porter


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

Date: Wed, 26 Aug 1998 10:12:02 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl compiler
Message-Id: <35E417B2.5E46@min.net>

Tom Christiansen wrote:
> 
> For example, if I extemporaneously develop an example program while
> teaching on site, I expect to be able to use that code in courses
> presented to other companies, and I expect those whom I teach to be able
> to show that code to whomever they please.  

I assume that this does not extend to code which is actually
useful/valuable to the company, which they actually paid you
to write.  (Correct me if I'm wrong.)

-- 
John Porter


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

Date: Wed, 26 Aug 1998 16:42:49 +0200
From: Bruce Smith <9401962_@ml.petech.ac.za>
Subject: Re: Posting JPEG-images from CGI-script...
Message-Id: <35E41EE9.A60B7BC4@ml.petech.ac.za>

I think what needs to be done here is to return a content header Content-Type:
image/jpeg with the required two returns and then read the binary data from the
file
to stdout. Check out the perl scripts that setup counters available from most
archives, they have the code for returning GIF's, and there should be no
difference.

Bruce Smith

MrNobody wrote:

> On 19 Aug 1998, Administrator wrote:
> > Could you please help me to find out how to return to the client's machine
> > a JPEG- or GIF- images from CGI-script, written on PERL.
> >
> > I heard that an image could be sent form a server with the help of and HTTP
> > headers i.e.: "Content-Type: image/x-xbitmap/n/n". But it appeares to  me
> > that this commands works only w/ XBM images.
>
> Do you realy wish to create your image in perl? Or are you trying to
> simply return a pre-existing image from a CGI script? If you just want to
> return an existing image with CGI, you would pass back:
>
> Location: $image_location\n\n
>
> which would cause the browser to go to $image_location to get the image
> you wanted. I know this is not a complete answer, but I think you might be
> able to asemble your application from pre-existing images, and save a lot
> of code. I you MUST generate the pics, then this is no help.
>                                                 -MrNobody
>                                                    I dont exist, so
>                                                    stop looking at me.
>
> perl -e 'print pack("C*",10,rs(231266),&v,32,rs(17528),rs(235297),&v,32,
> rs(195292),&v,32,rs(19496),rs(27979),10);sub v{rand(26)+97};
> sub rs{srand($_[0]);(&v,&v,&v);}'

 



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

Date: Wed, 26 Aug 1998 16:51:35 +0200
From: Bruce Smith <9401962_@ml.petech.ac.za>
Subject: RE Losing digits on numbers with magic increment
Message-Id: <35E420F7.FE922B0@ml.petech.ac.za>

I have a problem. I have a large number of scripts on a Web server and
each script logs an access number each time it is run. What I do is
store the number in a file, read it in using $Num = <FOO> and chop the
eol character. I then use $Num++ and write the number back to the file
with print FOO "$Num\n". What happens, and I'm not really sure why, the
number clocks over, it happened at 65536 and again at about 80000.

What am I doing wrong, and how can I fix it. Any help will be
appreciated.

Bruce Smith
Kill the antispam underscore in my email for my real address



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

Date: 26 Aug 1998 16:58:32 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: RE Losing digits on numbers with magic increment
Message-Id: <7xg1ejg57r.fsf@salome.vcpc.univie.ac.at>

Re: RE Losing digits on numbers with magic increment, Bruce
<9401962_@ml.petech.ac.za> said:

Bruce> I have a problem. I have a large number of scripts on
Bruce> a Web server and each script logs an access number
Bruce> each time it is run. What I do is store the number in
Bruce> a file, read it in using $Num = <FOO> and chop the
Bruce> eol character. I then use $Num++ and write the number
Bruce> back to the file with print FOO "$Num\n". What
Bruce> happens, and I'm not really sure why, the number
Bruce> clocks over, it happened at 65536 and again at about
Bruce> 80000.

It's because there are lots of punters flocking to your
site.

You are presumably getting multiple accesses `at the same
time' which means there are 2 scripts trying to read/write
the same counter file at the same time.

So...you need to implement file locking on the counter file.

See perlfaq5,

    "How can I lock a file?"
and
    "I still don't get locking.  I just want to increment
     the number in the file.  How can I do this?"

hth
tony

PS The pun is intentional, no points for finding it.
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien,  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: Wed, 26 Aug 1998 09:25:18 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Regex question - removing HTML tags....
Message-Id: <es51s6.min.ln@metronet.com>

iada@hplb.hpl.hp.com wrote:

:    I'm very new to perl and haven't got my head around the joys of regular
: expressions -> I came across this example for removing the HTML tags from a
: string 

   This illustrates the Danger of using the 
   Dreaded OPC (Other People's Code).

   The code below reveals that its author just kind of poked around
   until the code mostly worked without really knowing what they were
   doing.

   It doesn't work for _all_ HTML tags either, just "most".



: and can't work out how it works:

   For "removing HTML tags", it does *not* work.

   This subject has been beaten to death in many previous threads
   in this newsgroup.

   A Dejanews search in c.l.p.misc for Subject "HTML tags" finds
   "about 2500" matches.

   See? 

   To death.

   Answered many times over.

   Boring.

   Time wasting.

   'nuff said.



   ...but understanding regexs *is* worthy of some discussion...



: $value=~s/<([^>]|\n)*>//g
              ^^^^^^^

   This is the part that reveals some misunderstanding.
   
   [^>] can _already_ match a newline character, so the \n is not needed
   (and will never match). The author also used capturing parenthesis
   but made no use of the captured value. This is "better" (for some
   loose, inaccurate definition of "better"):

      $value=~s/<[^>]*>//g;

  "works" the same.



   Of course, regexs alone are not of sufficient power to do it right.
   (see the above mentioned thousands of times that this has
    already been said  ;-)

   Try "yours" on this:

      $value = 'Before tag<IMG SRC="hi.jpg" ALT=">> Hello! <<">After tag';


: from what I understand it strips the < > pair and anything inbetween, the []
                                                    ^^^^^^^^

   Not "anything". Only those that _match_ what is allowed between.


: being a character class, the parenthesis being a group and the * being one or
: more tokens to match (the g being  global replace?)


   Right. 

   Except * means _zero_ or more.  + means one or more.


: However....I'm confused by the caret - not the beginning of a string in this
: context? 

   Right again.

   Under the heading "Version 8 Regular Expressions" in the 'perlre'
   man page that is included with perl, it says:


      If the first character after the "[" is "^", the class 
      matches any character not in the list.


   It means "match a character that is NOT in the class".


: and the | in the character class...


   Not needed at all, as mentioned above.

   But it is not "in" the character class.

   It forms an "alternative" to the character class.


: I've tried consulting the man pages as well as all the tutorials I could find,
: and am still stuck :-(


   Hmmm. 

   I found the above quote by looking at the 13 times a word search 
   found "character class".

   Took me about 20 seconds to find the answer.

   Find out how to do a word search of the standard Perl docs, and
   work smart.

   Bet it took you more than 20 seconds to type up your post...


: Can anyone tell me how this works 

   That's not really worth it, since it doesn't really work.

   You seem to have most of it under control already though.

   Good Luck in learning regular expressions. There is Power there.


: and/or point me in the direction of an
: idiots guide to Regular expressions?

   Idiots are not capable of understanding regular expressions.

   Not to be denigrating, but REs are complex and just plain
   require some degree of non-idiotness to be grokked    ;-)



   "Mastering Regular Expressions" by Jeffrey Friedl (www.ora.com)
   is the best RE book that I know of.



--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 26 Aug 1998 10:37:33 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: webcounter in Perl?
Message-Id: <fl_aggie-2608981037330001@aggie.coaps.fsu.edu>

In article
<Pine.OSF.3.96.980826110108.6618A-100000@mira.iskp.uni-bonn.de>, Marc
Busch <mbusch@iskp.uni-bonn.de> wrote:

+ Hi,
+ I need some hints on how to program a webcounter in Perl

I presume that you mean "something that counts the number of hits on
a page"? You do realize that number is misleading, and is difficult
to interpret its meaning?

James


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

Date: Wed, 26 Aug 1998 10:25:58 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Y2K Date Support
Message-Id: <35E41AF6.5313@min.net>

I R A Aggie wrote:
> (Michael J Gebis) wrote:
> + That is, assuming you survive the C.H.U.D.s.
> 
> C.H.U.D.s? or is this in the jargon file?

I'm guessing it's an 'in' joke for those who
went to the Conference.

-- 
John Porter


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

Date: Wed, 26 Aug 1998 14:46:03 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Y2K Date Support
Message-Id: <6s179d$des$2@ligarius.ultra.net>

jdporter@min.net wrote:
-> I R A Aggie wrote:
-> > (Michael J Gebis) wrote:
-> > + That is, assuming you survive the C.H.U.D.s.
-> > 
-> > C.H.U.D.s? or is this in the jargon file?
-> 
-> I'm guessing it's an 'in' joke for those who
-> went to the Conference.

http://us.imdb.com/Title?C.H.U.D.+(1984)

C.H.U.D was a B flick made in '84 and I think that Gebis recently saw it and 
it was just fresh in his mind.

I'm not sure if it was mentioned at the conference.

Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-400-1972 
  Ext: 1949 and let the jerk that answers know 
  that his toll free number was sent as spam. "


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

Date: Wed, 26 Aug 1998 07:59:18 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Yes, someone else in need of PERL help
Message-Id: <6r01s6.l8n.ln@metronet.com>

GREGORY GILLELAND (gregory@bit.csc.lsu.edu) wrote:
: I have read a majority of the last 400 posts, I have searched the internet
: and found numerous FAQs and tutorials, and I have tried for 5 hours to


   Sounds like you are a Good Usenet Citizen.

   But I'm wondering how you did your research. I don't see the very
   *first place* that should be checked in your list of resources
   above. (that would be the docs that are shipped with perl).


   open() and close() are *func*tions, so looking in the 'perlfunc'
   man page for those would be a Good Idea.

   Doing a word search for "line number" would find out how to
   determine line numbers.

   Doing a word search for "equal" would find out how to compare
   two strings for equality.



: implement this myself... that being said, I need help.


   Where is the code that you are having trouble with?

   Hard to troubleshoot invisible code...


: If you would like to email me suggestions, I would appreciate it
: immensely. 


   But then when "someone else in need of PERL help" reads the majority
   of the last 400 posts, they won't find the answer.

   That seems a rather selfish approach.


: If you would like to vent your daily frustrations on me or
: inflate your monstrous ego, then so-be-it. But do it on the forum so the
: nice people can see your generous comments (dont junk my box with it).


   Sounds like you are a Good Usenet Citizen who objects to folks
   who point out to Bad Usenet Citizens how to become Good.

   Do you remain silent when someone cuts in front of you in a line?

   Or do you politely point out to them that it is socially unacceptable
   to do that?

   If you do, do you get a response like 
      "Oh. Sorry. I didn't know I had to wait my turn" 
   or do you get a 
      "4Q, I'm staying here in the front"?

   Are you similarly polite when a second person takes cuts?

   Are you still polite when the two-hundredth person takes cuts?


: Ok, 
: I would have thought this very easy but it isn't working out that way.
: I want to perform the following task using PERL:

: --open up a predefined file, read in the 3rd line, close the file.

   I dunno what a "predefined file" means.

   Do you mean that the _name_ is predefined or something?

   I will assume s/predefined file/existing file/;


   open(FILE, 'existing.file') || die "could not open 'existing.file'  $!";
   while (<FILE>) {
      last if $. == 3;
   }
   close(FILE);

   OR

   open(FILE, 'predefined.file') || die "could not open 'predefined.file'  $!";
   <FILE>;   # line 1 into the bit bucket
   <FILE>;   # line 2 into the bit bucket
   $line3 = <FILE>;
   close(FILE);


: --check that string to another predefined string

   I dunno what that means either.


: --if the strings ARE equal then <do something... (i can do this)>

   Oh. I guess you meant "check equality between that string and another".

   if ($line3 eq "another predefined string\n") {
      # do something
   }


: Everything is properly working. 

   That can't be correct.

   Why post a question if everything is working properly?   ;-)


: No server errors. 

   Perl has no server.

   I guess you are using Perl in some non-usual environment that you
   are not telling us about...


: I got the file to open
: and close, I have read in the predefined string from a FORM (and tested it
: by printing to file), but I cant get the reading of the third line to work
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

   So everything is NOT properly working  ;-)


: or subsequently the string comparison. If you need more info, please
: email.


: Thanks in Advance,

   Right.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

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

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