[9554] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3148 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 14 04:07:17 1998

Date: Tue, 14 Jul 98 01:00:55 -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           Tue, 14 Jul 1998     Volume: 8 Number: 3148

Today's topics:
    Re: -w on production code (was Re: better way of gettin <jimbo@soundimages.co.uk>
        AdminMisc - Determining if disk is compressed <nobody@southernco.com>
    Re: arrays and pattern matching (Patrick Timmins)
    Re: file download in Perl (Thomas Wernitz)
    Re: Forcing DOS window to stay open (Sam Holden)
    Re: Help with tutorial please... <jgraham@uvic.ca>
    Re: HELP: Internet Database Design questions... <nheagy@cintek.com>
    Re: HELP: Internet Database Design questions... <jamiec@hampton.co.uk>
    Re: I am an "antispam spammer"? <3srf@qlink.queensu.ca>
    Re: I am an "antispam spammer"? (John Oliver)
        Indentation <scribble@pobox.com>
    Re: Perl 4 compilation on Solaris 2.6 (I R A Aggie)
    Re: Perl Control Codes (I R A Aggie)
    Re: perl IDE and compiler (Martien Verbruggen)
        portability of -s <squid@panix.com>
    Re: Putting CPAN on a CD: good or not good? (I R A Aggie)
    Re: Recommend me Perl! <tchrist@mox.perl.com>
    Re: Recommend me Perl! (I R A Aggie)
    Re: Recommend me Perl! <zkessin@lhr-sys.dhl.com>
    Re: References to Anonymous subroutines <metcher@spider.herston.uq.edu.au>
    Re: RegExps: Check if string consists of EXACTLY 3 digi (I R A Aggie)
        Run a new page from the output of cgi script <mariatw@pendragon.net>
    Re: Run a new page from the output of cgi script <jgraham@uvic.ca>
    Re: Run a new page from the output of cgi script <jgraham@uvic.ca>
    Re: script opening another script (David A. Black)
    Re: talking to POP3 servers <pgunn01@ibm.net>
    Re: talking to POP3 servers <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: unpack (Ronald J Kimball)
    Re: unpack (brian d foy)
        WebBots <darrensw@pacbell.net>
    Re: WebBots (brian d foy)
    Re: WebBots (Abigail)
    Re: What's the substitute for #! /usr/bin/perl in Win32 (Craig Berry)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 14 Jul 1998 07:44:14 +0100
From: Jim Brewer <jimbo@soundimages.co.uk>
Subject: Re: -w on production code (was Re: better way of getting the last modified file?)
Message-Id: <uww9h7wzl.fsf@jimbosntserver.soundimages.co.uk>

cberry@cinenet.net (Craig Berry) writes:

> 
> Bart Lateur (bart.mediamind@tornado.be) wrote:
> : Mike Stok wrote:
> : >Why not leave it as it is?  People who want warnings can use -w...
> : 
> : Because newbies don't know about -w, while it's the most benificial to
> : them. Just look at the PODs. I strongly feel that something that should
> : be used by newbies, ought to be the default.
> 
> <joke>
> How about having each copy of the Perl binary built with -w on by default.
> The binary would patch itself to turn -w off by default the first time a
> hash of lists of hashes was created successfully.
> </joke>

<kinda-tongue-in-cheek>
So what's the jike? That would be a good approach. Everbody's a
winner. Newbies would always wonder what the hell all the extra
messages are about and gurus would always know the pain and suffering
being visted upon the unknowing and the ingnorant and the
petulant. Great idea. Are you going to provide the patch for the next
release?
</kinda-tongue-in-cheek>

Jim Brewer



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

Date: Fri, 10 Jul 1998 17:30:31 -0500
From: "Southern Company Default News User" <nobody@southernco.com>
Subject: AdminMisc - Determining if disk is compressed
Message-Id: <6o64ic$2el$1@news.scsnet.com>

I'm using Perl to generate a web page displaying the disk space for servers
in our domain.  I'm having two major problems I could really use some help
on.

1)  I can't seem to find a way to determine if a drive is compressed.

2)  ADMINMISC doesn't see our external disk arrays (Storage Dimensions
boxes)  It returns only internal drives such as the floppy, the hard drives,
and the CD Rom drives.  I thought DRIVE_REMOTE might return it as a network
drives but nothing is returning our external disk arrays.

We are having a problem with compressed drives on our Exchange servers
corrupting the message store when the disk space gets low.  I need to get
this information and don't want to do it server by server, drive by drive.
<grin>  Any help would be appreciated.

Please reply directly to my e-mail address (jmgranad@southernco.com) as well
as the newsgroup.

Thanks,

John Granade
The Southern Company
jmgranad@southernco.com





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

Date: Tue, 14 Jul 1998 03:53:02 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: arrays and pattern matching
Message-Id: <6oekmu$gjr$1@nnrp1.dejanews.com>

In article <35AA43B6.4800C566@mda.ca>,
  Naomi Wyman <nwyman@mda.ca> wrote:
> I am trying to match a pattern based on values in an array, which are
> all strings. I'm thinking using something like: /(\b[@Types]+\b)\s+/i).
> For the data I have this seems to work just fine, but I'm concerned that
> I may be missing something and on other strings this will fail. So my
> question is: Does this really match the entire string or just parts of
> it? And does anyone have any better suggestions.
>
> Thanks,
> Naomi
>

Let me see if I'm following you. You have a string, say $string and you have
an array called @Types. You want to see if any of the elements in @Types are
in $string, paying attention to word boundaries. If this is so, how about
something like:

@Types = qw(dog smog cat rat); $string = "The smoggy Dog snacked on the
highly rated cat."; $i = 0; foreach $Types (@Types) {  if ($string =~
/(\b$Types\b)/i) {  print "\$string contains $1 (which caselessly matches
\@Types\[$i\])\n";  }  ++$i; }

This would print out:

$string contains Dog (which caselessly matches @Types[0])
$string contains cat (which caselessly matches @Types[2])

and would ignore 'smoggy' and 'rated' in your $string string.

Is this in line with what you're looking to do?
Hope that helps.

Patrick Timmins
U. Nebraska Medical Center

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


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

Date: Mon, 13 Jul 98 20:37:03 GMT
From: NOSPAM.thomas_wernitz@tait.co.nz (Thomas Wernitz)
Subject: Re: file download in Perl
Message-Id: <6odurq$ii6$1@wolfman.xtra.co.nz>

In article <35a63aea.0@news.primary.net>, "Bob Tate" <btate@twa.com> wrote:
>I am seeking help on developing Perl code that would download a file or
>files from a web server and store it on the local (user's) PC.  any ideas?

look for lwp-download, it comes with the LWP module I think.

HTH,
Thomas

"most people would die sooner than think -- in fact, they do so."
                                                         -- Bertrand Russell


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

Date: 14 Jul 1998 06:21:01 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Forcing DOS window to stay open
Message-Id: <slrn6qlu6d.i01.sholden@pgrad.cs.usyd.edu.au>

On Mon, 13 Jul 1998 20:12:17 GMT,
	willwebber@my-dejanews.com <willwebber@my-dejanews.com> wrote:
>Hello all. I just recently put PERL on my home system(Win95) to work on some
>things locally before uploading to the server. And, I seem to have a problem
>keeping the DOS window open that the PERL runs in. I tried throwing a line of
>code in that waits for you to hit a key before it quits the program (waits
>for a STDIN entry). But, this method only seems to work if the code runs okay
>without breaking. If the code breaks, the window shows the errors (for a
>split second) then closes. Any suggestions on how to force it to stay open
>regardless of the events of compile and run?  Any suggestions would be
>great--

Start a DOS window up forst and then run the perl script from the command
line, instead of running it by double clicking (or equiv.) on the file in
windows. That way the 'command' doesn't finish until youtype exit into
the DOS prompt, so windows doesn't close the window...

Sam

-- 
Oh my God! They killed Kenny. You Bastard!!!


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

Date: Tue, 14 Jul 1998 07:42:50 GMT
From: "Jonah Graham" <jgraham@uvic.ca>
Subject: Re: Help with tutorial please...
Message-Id: <_ZDq1.3871$xs3.2222264@news.rdc1.bc.wave.home.com>

#!/usr/local/bin/perl
#
# Program to open the password file, read it in,
# print it, and close it again.

$file = '/etc/passwd';  # Name the file
open(INFO, $file);          # Open the file
@lines = <INFO>;            # Read it into an array
close(INFO);                # Close the file

$, = "#";                    # This sets the field separator to a pound.
                            # That way a # will be printed between each
element
                                                        # of the array.
print @lines;               # Print the array

This will leave you with a missing # before the first line, so change the
last line to:
print "", @lines;
that will cause an extra # to be printed between the "" and the first
element of @lines.

I believe your problem may have been that (I think) the webpage wrongly
suggests using a $" instead of $,.

Good Luck,
Jonah

    Christopher Moll wrote in message <35AAB4E8.C590B259@webfarms.com>...
    Will some kind soul (or rotten bastard will even do ) please show me the
solution to the exercise on this page?   Perl tutorial: File handling  thank
you in advance.




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

Date: Tue, 14 Jul 1998 00:06:40 -0700
From: "Nathan R Heagy" <nheagy@cintek.com>
Subject: Re: HELP: Internet Database Design questions...
Message-Id: <6oep9d$99r$1@news.junction.net>

I agree on all point given, however, I am running an Access-based flat-file
database for one of my clients simply because they want to. They have light
traffic, and since they are on Unix, I feel they are protected enough for
any scaling that may be needed in the future.
--
Nathan R Heagy
-- -- --
Sites Built Better
http://heagy.com


- wrote in message <35aa9523.19867848@nntp.idsonline.com>...
>Catherine Skidmore <eppie@interport.net> Said this:
>>> >ooh. Access and ASP. or Access and Cold Fusion.
>>>
>>> Oh my GOD.  No.
>>
>>care to defend that?
>
>Sure.  If you plan on having an internet server, and you choose NT,
>you are defeating yourself before you even start.




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

Date: Tue, 14 Jul 1998 08:42:58 +0100
From: "Jamie Cruise" <jamiec@hampton.co.uk>
Subject: Re: HELP: Internet Database Design questions...
Message-Id: <900402021.16586.0.nnrp-03.c3ad2585@news.demon.co.uk>

Hi,

    Without wishing to fuel a long and tedious debate, lets just say that
this post does little justice to a flexible, capable platform. You may wish
to read some more balanced head-on reviews between the various server
platforms (try searching some back issues of byte for one). I am afraid that
NT & IIS cannot be dismissed so easily.

regards Jamie Cruise.

- wrote in message <35aa9523.19867848@nntp.idsonline.com>...
>Catherine Skidmore <eppie@interport.net> Said this:
>>> >ooh. Access and ASP. or Access and Cold Fusion.
>>>
>>> Oh my GOD.  No.
>>
>>care to defend that?
>
>Sure.  If you plan on having an internet server, and you choose NT,
>you are defeating yourself before you even start.   Sure, you'll be
>able to get a room full of administrative and non-technical people to
>make up some nice looking pages and hook your database into it, and
>all kinds of things - but what will happen is that your NT server will
>end up being down more often than it is up.  NT is unstable, it scales
>horribly, it cannot handle medium traffic loads (even with a dual
>pentium pro, which I've tried oh so hard to make work with NT)
>
>What good is a "web server" that has all kinds of downtime?  If
>someone tries to access your site when the server is down, they'll sit
>there for a few seconds, get an "Unable to connect to remote host"
>error message, find a search engine and locate one of your
>competitors.  Simple fact.
>
>>> >an NT Box running IIS.
>>> >
>>>
>>> Argh.  New to computing?  Must be.
>>
>>wrong again.
>>
>
>Just because you've had a pc on your desk for a couple years does not
>make you technically literate.  Using word, or netscape is not a
>computer skill, it's being a computer user.  Being a computer user
>does not qualify you to make suggestions about network environments.
>
>




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

Date: 14 Jul 1998 04:17:44 GMT
From: Frampton Steve R <3srf@qlink.queensu.ca>
Subject: Re: I am an "antispam spammer"?
Message-Id: <6oem58$q2q$2@knot.queensu.ca>

In news.admin.net-abuse.email Jordyn A. Buchanan <jordyn@bestweb.net> wrote:
: Well, perhaps the reponse isn't material that's really widely useful, so
: it's sent off as an e-mail in order to avoid cluttering the newsgroup.  If
: you don't actually *check* the e-mail address before you send it off, you
: end up with a bounce.

Wait a second...who the hell sends mail without checking who its going to
first?  (Yeah, I know...lots of people...that doesn't make it a good idea)

It's really a good idea to make sure you don't send something to somebody
you don't really want to.  *Always check the recipient before sending a
message*.

--------------< LINUX: The choice of a GNU generation. >--------------
Steve Frampton  <3srf@qlink.queensu.ca>  http://qlink.queensu.ca/~3srf


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

Date: Tue, 14 Jul 1998 05:29:45 GMT
From: do.not.reply@this.address (John Oliver)
Subject: Re: I am an "antispam spammer"?
Message-Id: <35abecec.892509150@news.escnd1.sdca.home.com>

On 14 Jul 1998 04:17:44 GMT, Frampton Steve R <3srf@qlink.queensu.ca>
wrote:

>Wait a second...who the hell sends mail without checking who its going to
>first?  (Yeah, I know...lots of people...that doesn't make it a good idea)
>
>It's really a good idea to make sure you don't send something to somebody
>you don't really want to.  *Always check the recipient before sending a
>message*.

You better watch it... you're saying things that make sense, and that
won't be tolerated 'round these parts! :-)

-- 
If you want to reply to me, do it in the newsgroup... It's 
been too long since I've received anything other than spam 
in my mailbox from posting my address in the newsgroups.


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

Date: 14 Jul 1998 01:27:25 -0500
From: Tushar Samant <scribble@pobox.com>
Subject: Indentation
Message-Id: <6oetod$6sb@tekka.wwa.com>

I am now confused about indentation. Here is what I do: always indent
with a tab, no matter what. Never a space. On the other hand, I always
use spaces to "line things up" among lines with the same indent. Maybe
my first programming boss WAS particularly anal, but I agree with this
specific decision.

A lot of (e.g.) CPAN code has a common pattern -- the indents are tabs
and 4 spaces. I think that's rather like writing browser-specific HTML,
because I HAVE to set my tabstops to 8 to read it. I generally like
them more cuddled, 3 or even 2. So, chalk me up as someone who doesn't
understand why there are spaces in the initial indent, and why people
set tabstops different from shiftwidths. (Sorry if I am using a vi-
specific term here, but I think the meaning is clear.)

On the other hand, there's code which uses tabs to line things up
in the middles of lines! That is not very tabstop-friendly either.
As for spaces-only indentation -- to continue the metaphor, that's
like formatting an HTML page with pixel-width directives; you have
to insist on Netscape ...

I wonder if I am missing the point of tabstop 8, shiftwidth 4...
why not use tabs only and let the reader decide what's good for
her.



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

Date: Mon, 13 Jul 1998 17:32:57 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Perl 4 compilation on Solaris 2.6
Message-Id: <fl_aggie-1307981732570001@aggie.coaps.fsu.edu>

In article <35AA4554.3C5DFB05@cig.mot.com>, Brad Skrbec
<skrbec@cig.mot.com> wrote:

+ Has anyone successfully compiled version 4.036 on Solaris 2.6?  If not,
+ can anyone clue me in on what Perl 4/Perl 5 incompatibility problems I
+ may run into?

<url:http://www.perl.com/> should have a "Gotcha's" page concerning these
issues.

James


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

Date: Mon, 13 Jul 1998 17:31:52 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Perl Control Codes
Message-Id: <fl_aggie-1307981731530001@aggie.coaps.fsu.edu>

In article <6odh15$nam$1@jupiter.inter-view.net>, "Scott Bingham"
<sbingham@miv.net> wrote:

[one of the more entertaining "how do I decode input to a CGI script" post
 I've seen in a long time]

+ Thank you for your time and efforts...  Please reply as soon as possible if
+ you can provide any relevant information.

use CGI;
my %values;
my $query = new CGI;
my @names = $query->param;
foreach my $name (@names) {
  $values{$name}=$query->param($name);
  print "Name: $name -- Value: $values{$name}\n";
}

Allow the CGI.pm module to do the hard, boring, and tedious (and thus prone
to error) jobs. Good news! CGI.pm is included in the standard perl
distribution (as of 5.004_04), and it will allow CGI scripts to be
run in an interactive mode, or by reading from an input file for testing
purposes.

James

Ps. The current version of CGI.pm is available at

 http://www.genome.wi.mit.edu/ftp/pub/software/WWW/cgi_docs.html
 ftp://ftp-genome.wi.mit.edu/pub/software/WWW/


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

Date: 14 Jul 1998 04:18:17 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: perl IDE and compiler
Message-Id: <6oem69$4se$1@comdyn.comdyn.com.au>

In article <35AAC438.1FE3A2E7@erols.com>,
	"Matthew O. Persico" <mpersico@erols.com> writes:
> stlam@yahoo.com wrote:
> 
>> Is there any Perl compiler for win32/unix?
> 
> Xemacs 

Since when is emacs a compiler?

The correct answer of course is: perl.

Go to http://www.perl.com/latest.html and look around there.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | The number of the beast is not 666. The
Commercial Dynamics Pty. Ltd.       | number is 95, and it's awake.
NSW, Australia                      | 


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

Date: 14 Jul 1998 03:54:29 -0400
From: Yeoh Yiu <squid@panix.com>
Subject: portability of -s
Message-Id: <oxgoguskgui.fsf@panix.com>

Does the -s test for file size return the same number
for the same file if I copy this file to various file systems ?

p85 of the blue camel doesn't say size is measured in bytes
but I assume it to be so.

squid. 
red-hat linux fdisk sure has a lot of formats ...


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

Date: Mon, 13 Jul 1998 17:15:21 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Putting CPAN on a CD: good or not good?
Message-Id: <fl_aggie-1307981715210001@aggie.coaps.fsu.edu>

In article <comdog-ya02408000R1307981521100001@news.panix.com>,
comdog@computerdog.com (brian d foy) wrote:

+ but, being the americentric-never-lived-outside-of-North-America person
+ that i am, i appreciate the comments about the expensive online charges
+ for overseas.  kinda easy to forget when you have a T1 (literally)
+ next to your desk. :)

That's why spam is such a big deal and the "oh, just delete the spam"
argument falls on its face.

Besides, never underestimate the bandwidth of a truckload of 9 track
tapes hurtling down the highway.

James - if they're 9 tracks, perferablly hurtling over a cliff...


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

Date: 14 Jul 1998 04:11:00 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Recommend me Perl!
Message-Id: <6oelok$21o$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, rjk@coos.dartmouth.edu (Ronald J Kimball) writes:
:I believe so.

Don't go there.  

Just

don't.

--tom
-- 
/* This bit of chicanery makes a unary function followed by
   a parenthesis into a function with one argument, highest precedence. */
        --Larry Wall in toke.c from the perl source code


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

Date: Mon, 13 Jul 1998 17:11:44 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Recommend me Perl!
Message-Id: <fl_aggie-1307981711440001@aggie.coaps.fsu.edu>

In article <6odnon$cul$1@nnrp1.dejanews.com>, c960901@student.dtu.dk wrote:

+ I've never written a line of Perl, but I'm going to in the very near future.
+ I need someone to recommend me -the best- Perl book available.

Depends on your level of programming expertise. If you're a pretty good
programmer, go get the Camel book (Programming Perl, 2nd edition).

+ What can Perl do?

Lots.

+ Can it scan a directory for subdirs and files and return the names in a
+ string array?

Judge for yourself:

NAME
    find - traverse a file tree

    finddepth - traverse a directory structure depth-first

SYNOPSIS
        use File::Find;
        find(\&wanted, '/foo','/bar');
        sub wanted { ... }

        use File::Find;
        finddepth(\&wanted, '/foo','/bar');
        sub wanted { ... }

DESCRIPTION
    The wanted() function does whatever verifications you want.

[etc]

James


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

Date: 14 Jul 1998 08:19:54 +0100
From: Zachary Kessin <zkessin@lhr-sys.dhl.com>
Subject: Re: Recommend me Perl!
Message-Id: <m3n2acj3vp.fsf@pc-hhu-52.lhr-sys.dhl.com>


rjk@coos.dartmouth.edu (Ronald J Kimball) writes:

> Tom Christiansen <tchrist@mox.perl.com> wrote:
> 
> >  [courtesy cc of this posting sent to cited author via email]
> > 
> > In comp.lang.perl.misc, rjk@coos.dartmouth.edu (Ronald J Kimball) writes:
> > :Tom Christiansen <tchrist@mox.perl.com> wrote:
> > :> _Programming Perl_ (Wall, Christiansen, and Schwartz)
> > :
> > :You forgot to mention Stephen Potter.
> > 
> > I did?
> 
> I believe so.
> 
> Programming Perl, Second Edition
> by Larry Wall, Tom Christiansen, and Randal L. Schwartz, with Stephen
> Potter

Stephen Potter's name is not on the cover or spine, it is on the
inside title page. At least on my cammel book here. (Yes its on my
desk at all times)

--Zach Kessin



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

Date: Tue, 14 Jul 1998 14:24:05 +1000
From: Jaime Metcher <metcher@spider.herston.uq.edu.au>
Subject: Re: References to Anonymous subroutines
Message-Id: <35AADD65.77D11733@spider.herston.uq.edu.au>

The anonymous sub hangs around for as long as the reference ($rs in your
example) is in scope.  For an example of using anonymous sub references
for an elegant solution to a problem that would otherwise be quite
messy, see the docs for Benchmark.pm.

-- 
Jaime Metcher 

Gil Brown wrote:
> 
> Hi;
> 
> I was going through some litterature on Perl (Advanced Perl programmind by
> O'reilly) and found that you can declare anonymous subs by omitting the name
> in a sub declaration. The example was:
> 
>                 $rs = sub {
>                                     print "hello \n";
>                                 };
> 
> It's suppose to return a reference to the newly created sub. Can anyone tell
> me how it works?? Let say you declare such a routine can it be referenced to
> somewhere else in the program? And what would be the use in declaring an
> anonymous sub (Real world application).
> 
> Thanks


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

Date: Mon, 13 Jul 1998 18:05:34 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: RegExps: Check if string consists of EXACTLY 3 digits ??
Message-Id: <fl_aggie-1307981805350001@aggie.coaps.fsu.edu>

In article <35AACA77.D9C@alpha.futurenet.co.za>,
karsten.no.123.spam@alpha.futurenet.co.za wrote:

+ I am writing a CGI script which accepts input via QUERY_STRING. 
+ However, the input is only valid if it consists of EXACTLY 3 DIGITS!  No
+ more , no less, no other characters in front, after or in between the
+ digits.  Ive tried things such as:

+ if ($ENV{'QUERY_STRING'} =~ /[0-9]\{3\}/)

Which is close. What I came up with is: ~/^\d{3}$/. \d is shorthand
for [0-9], so you're real close.

I hate anchoring the regex with ^ and $, but I don't see any other way
to not match 4+ digits. The Blue Camel (pg 63) speaks of using a
ranging of {n,m}? as a minimal matching, such that at least n times
occur, but no more than m times. But...

/\d{3,3}?/ will match 3, 4 or more digits. Which makes sense, actually
since it _does_ match _exactly_ 3 digits.

Slightly confuzzled,

James


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

Date: Tue, 14 Jul 1998 13:34:27 +0800
From: Maria TheresiaWettstein <mariatw@pendragon.net>
Subject: Run a new page from the output of cgi script
Message-Id: <35AAEDE3.7818DFDF@pendragon.net>

Hello everybody,

I need some help here. I have an output sreen which show me what the
users entered and uploaded so far but I really need to go ahead to a new
form which reads some of the data in which was submitted earlier.

Somebody told me to use:

print"Location:http://www.pendragon.net/classifieds/ad_by_week.mv";

but nothing happens. Can somebody advise me what to do and maybe how to
set up this correctly.

Also how do I get the new form to display the variables which come from
the script?

Any tips are very much appreciated.

Maria Theresia Wettstein




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

Date: Tue, 14 Jul 1998 07:12:04 GMT
From: "Jonah Graham" <jgraham@uvic.ca>
Subject: Re: Run a new page from the output of cgi script
Message-Id: <8xDq1.3866$xs3.2209462@news.rdc1.bc.wave.home.com>

Your problem appears to be that there is no space between the colon and the
http://...

Hope that works,
Jonah

PS I recommend checking out documentation for http at w3.org.
http://www.w3.org/Protocols/ or;
http://www.w3.org/Protocols/rfc2068/rfc2068 or;
http://www.ics.uci.edu/pub/ietf/http/rfc1945.html

The last one is http/1.0, but is hyperlinked which makes browsing easier. I
am sure there is an http/1.1 that is hyperlinked, but I didn't really look
that hard.



Maria TheresiaWettstein wrote in message
<35AAEDE3.7818DFDF@pendragon.net>...
>Hello everybody,
>
>I need some help here. I have an output sreen which show me what the
>users entered and uploaded so far but I really need to go ahead to a new
>form which reads some of the data in which was submitted earlier.
>
>Somebody told me to use:
>
>print"Location:http://www.pendragon.net/classifieds/ad_by_week.mv";
>
>but nothing happens. Can somebody advise me what to do and maybe how to
>set up this correctly.
>
>Also how do I get the new form to display the variables which come from
>the script?
>
>Any tips are very much appreciated.
>
>Maria Theresia Wettstein
>
>




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

Date: Tue, 14 Jul 1998 07:16:34 GMT
From: "Jonah Graham" <jgraham@uvic.ca>
Subject: Re: Run a new page from the output of cgi script
Message-Id: <mBDq1.3868$xs3.2211414@news.rdc1.bc.wave.home.com>

Oops, I forgot that there is another way to do this. You could use a META
tag in a document if you wanted.

<META HTTP-EQUIV="refresh" content="0; url=homepage.htm"> The 0 is the
number of seconds to wait before the reload.

Jonah

Jonah Graham wrote in message
<8xDq1.3866$xs3.2209462@news.rdc1.bc.wave.home.com>...
>Your problem appears to be that there is no space between the colon and the
>http://...
>
>Hope that works,
>Jonah
>
>PS I recommend checking out documentation for http at w3.org.
>http://www.w3.org/Protocols/ or;
>http://www.w3.org/Protocols/rfc2068/rfc2068 or;
>http://www.ics.uci.edu/pub/ietf/http/rfc1945.html
>
>The last one is http/1.0, but is hyperlinked which makes browsing easier. I
>am sure there is an http/1.1 that is hyperlinked, but I didn't really look
>that hard.
>
>
>
>Maria TheresiaWettstein wrote in message
><35AAEDE3.7818DFDF@pendragon.net>...
>>Hello everybody,
>>
>>I need some help here. I have an output sreen which show me what the
>>users entered and uploaded so far but I really need to go ahead to a new
>>form which reads some of the data in which was submitted earlier.
>>
>>Somebody told me to use:
>>
>>print"Location:http://www.pendragon.net/classifieds/ad_by_week.mv";
>>
>>but nothing happens. Can somebody advise me what to do and maybe how to
>>set up this correctly.
>>
>>Also how do I get the new form to display the variables which come from
>>the script?
>>
>>Any tips are very much appreciated.
>>
>>Maria Theresia Wettstein
>>
>>
>
>




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

Date: Mon, 13 Jul 1998 17:53:46 EDT
From: dblack@saturn.superlink.net (David A. Black)
Subject: Re: script opening another script
Message-Id: <6odvla$l32$1@earth.superlink.net>

Hello -

faganb@my-dejanews.com writes:

>I have the following two scripts. The first prints, but the second never
>outputs anything. No error message is printed. What am I doing wrong?  Thanks
>for the help.

>Script 1:

>#!bin/perl
>print "This is a test\n";
>open (SUBPROC, "/u/tct/SuperScripts/hi.pl |") || die "Can't open subproc";
>print $_;


>Script 2:
>#!bin/perl
>print "hi world\n";


If you used -w, you'd be advised that $_ is uninitialized at the time
that you try to print it.  Presumably you want to print the data from
your pipe:

print <SUBPROC>;


David Black
dblack@saturn.superlink.net


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

Date: Tue, 14 Jul 1998 03:18:12 -0400
From: Pat Gunn <pgunn01@ibm.net>
Subject: Re: talking to POP3 servers
Message-Id: <35AB0634.366C@ibm.net>

Simon Wistow wrote:
> I apologise in adavnce if this causes mass groaning in the news group
> but I only started learning Perl last weekend on a 6am ferry from
> Ostende to Dover :/
> I am writing a POP3toWeb script (I know there are loads out there
> already but I'm doing it as a learning experience) and so far it will
> connect, logon and receive single line messages from the server however
> it all falls over when I try and  get multiline responses (in my case
> the reply to the "TOP x 0" command).
> 
> My code looks something like this
> 
> <connect and login>
> print S "TOP $message_no 0";   $a=<S>;
> while (<S>){
>         print $a;
>         $a = <S>;}

You can rely on the last line from TOP or RETR to have just a
"." in it, so you might do:

while(<S>)
	{
	if /^.$/ break;
	print $a;
	.....

and so on.

-- 
---------------------------------------------------
Pat Gunn, moderator:comp.sys.newton.announce
comoderator:comp.os.os2.moderated
"You can always judge a man by the quality of his enemies." -- Dr Who
http://junior.apk.net/~qc
------------------------------------------------


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

Date: 14 Jul 1998 09:19:52 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: talking to POP3 servers
Message-Id: <7xg1g46grr.fsf@fidelio.vcpc.univie.ac.at>

Re: talking to POP3 servers, Simon <smw3@doc.ic.ac.uk> said:

Simon> I am writing a POP3toWeb script (I know there are
Simon> loads out there already but I'm doing it as a

Time to go to http://www.perl.com/ and find out about the
wonders of CPAN.  There are some nice modules for handling
POP (e.g. Net::POP3).

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,      | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, AT | http://www.vcpc.univie.ac.at/

"You see? You see? Your stupid minds! Stupid! Stupid!" ~ Eros, Plan9 fOS.


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

Date: Tue, 14 Jul 1998 00:00:34 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: unpack
Message-Id: <1dc4qgt.b1db6e14ma4ufN@bay2-93.quincy.ziplink.net>

Shan-Leung Woo <leungwo@ms.com> wrote:

> Hello,
> 
> I have this piece of code, and I am curious about how to interprete the
> behavior of it. Can anyone here help me? 
> 
> @a = unpack 'b5', chr 31;
> print "$a[0]:$a[1]:\n";
> 
> I expect the output to be "1:1:\n" but it's actually "11111::". Why is
> that so? Is it because unpack returns a list of one element which is
> '11111'?

In that expression, yes, that is what unpack returns.  According to the
docs, the b specifier is for "a bit string, low-to-high order".  So
unpack returns a string, not a list.

> Beside using split // to make it a list of 1's, are there any
> other better methods?

That's how would I do it, although I don't know if it's the best way.

> Actually my problem is that I want to convert a
> scalar (int) to a list of bits, but I am too new to perl... :>

Your way works for me.  Watch for someone to post another way to do it,
though.

-- 
 _ / '  _      /         - 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: Tue, 14 Jul 1998 02:47:18 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: unpack
Message-Id: <comdog-ya02408000R1407980247180001@news.panix.com>
Keywords: from just another new york perl hacker

In article <1dc4qgt.b1db6e14ma4ufN@bay2-93.quincy.ziplink.net>, rjk@coos.dartmouth.edu (Ronald J Kimball) posted:

>Shan-Leung Woo <leungwo@ms.com> wrote:

>> Actually my problem is that I want to convert a
>> scalar (int) to a list of bits, but I am too new to perl... :>
>
>Your way works for me.  Watch for someone to post another way to do it,
>though.

vec() if fun, too :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers Travel Deals! <URL:http://www.pm.org/travel.html>


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

Date: Mon, 13 Jul 1998 21:14:44 -0700
From: "Darren Sweeney" <darrensw@pacbell.net>
Subject: WebBots
Message-Id: <6oem67$olr$1@nnrp3.snfc21.pbi.net>

Hi all,

Is there a benefit to using perl/cgi rather than Frontpage WebBots. i need
to make a decision which one to focus on.

All comments welcomed, thanks

Darren




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

Date: Tue, 14 Jul 1998 01:53:28 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: WebBots
Message-Id: <comdog-ya02408000R1407980153280001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6oem67$olr$1@nnrp3.snfc21.pbi.net>, "Darren Sweeney" <darrensw@pacbell.net> posted:

>Is there a benefit to using perl/cgi rather than Frontpage WebBots. i need
>to make a decision which one to focus on.

one can create spiders and one comes with ready-to-use bugs?

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers Travel Deals! <URL:http://www.pm.org/travel.html>


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

Date: 14 Jul 1998 05:54:30 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: WebBots
Message-Id: <6oerqm$oqb$1@client3.news.psi.net>

Darren Sweeney (darrensw@pacbell.net) wrote on MDCCLXXVIII September
MCMXCIII in <URL: news:6oem67$olr$1@nnrp3.snfc21.pbi.net>:
++ Hi all,
++ 
++ Is there a benefit to using perl/cgi rather than Frontpage WebBots. i need
++ to make a decision which one to focus on.
++ 
++ All comments welcomed, thanks


Webbots don't have airconditioning.



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: 14 Jul 1998 06:16:46 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: What's the substitute for #! /usr/bin/perl in Win32 Perl?
Message-Id: <6oet4e$8io$1@marina.cinenet.net>

Ronald J Kimball (rjk@coos.dartmouth.edu) wrote:
: <scott@softbase.com> wrote:
: > > I'm using the ActiveState Win32 Perl on an NT 4.0 system... what do I
: > > use in place of the first line (#! /usr/bin/perl) in Unix versions of
: > > the script ?
: > 
: > You don't. NT doesn't support this "magic number" style of
: > execution. 
: 
: Keep in mind that perl itself will still honor any command line switches
: on the #! line.  At the very least, you could just do
: 
: #!perl -w -i.bak
: 
: or whatever.

And for those of us who frequently schlepp scripts between the World of
Bill and more enlightened OSs, putting the canonical

  #/usr/bin/perl -w

up there buys both the -w switch and one less step in porting.  Unless, of
course, the semi-enlightened OS has it in /opt/gnu/bin or somesuch...

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

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

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