[11426] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5026 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 1 15:07:36 1999

Date: Mon, 1 Mar 99 12:03:02 -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, 1 Mar 1999     Volume: 8 Number: 5026

Today's topics:
    Re: regexp help (Mark P.)
    Re: Result unexpected! <gdschrij@eduserv2.rug.ac.be>
    Re: Statistics for comp.lang.perl.misc (Greg Bacon)
        SYNTAX ERROR REVISITED <paxtond@ix.netcom.com>
        Test file <aalmeida@amorim-revestimentos.pt>
    Re: The dumbest newbie question ever..? (Bart Lateur)
    Re: The truth about the Pentium III chip and ID --- **b <borama@dockside.co.za>
    Re: This Hostname/IP Convert script is not working <EvaDooRs@netzero.net>
        URGENT help required!! <r.partridge@dewynters.com>
    Re: Urgent: Help: limit to string size, or...? <gellyfish@btinternet.com>
        Using Perl to resize image? <john@terminalreality.com>
    Re: Using Perl to resize image? <pixel_@geocities.com>
    Re: using the perl open function <jglascoe@giss.nasa.gov>
    Re: Why isn't this a race condition ? (Bart Lateur)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Sun, 28 Feb 1999 19:18:43 GMT
From: mag@imchat.com (Mark P.)
Subject: Re: regexp help
Message-Id: <36d99510.604076425@news.ionet.net>

Well, yeah, not trying to, but the documentation for URL.pm seems to
be lacking in examples. It would be nice to get a few examples and
then I would have no problems.
URL.pm shows how to get a relative URL, but when I try to do it like
this, it shows the full url.

$file = "$url->rel($ENV{'HTTP_REFERER'})";

	I know its because I'm using the module wrong, but without
proper documentation including examples, its hard for a non-programmer
like me to pick up on it. Given a few examples I can pretty much
handle it.

On Sun, 28 Feb 1999 17:38:33 GMT, Eric Bohlman <ebohlman@netcom.com>
wrote:


>Don't reinvent the wheel.  Use the URI::URL module, which gives you all 
>sorts of methods for splitting and composing URLs.
>



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

Date: Mon, 1 Mar 1999 14:00:15 +0100
From: Glad Deschrijver <gdschrij@eduserv2.rug.ac.be>
Subject: Re: Result unexpected!
Message-Id: <Pine.GSO.3.96.990301135708.18281B-100000@eduserv2.rug.ac.be>

On Sat, 27 Feb 1999, Aaron Au wrote:

> Hi all,
> 
> -------------
> $temp = "\@abc1";
> $temp ++;
> print $temp;
> -------------
> The result is 1 but I expected the result is "@abc2".
> How to do that?
> Thanks!

$temp = "\@abc345"; 
$temp =~ s/(\d)+/$&+1/e;
print $temp;

Have a nice day,

---------------------------------------------------------------------------
Glad Deschrijver                 gdschrij_AT_eduserv2_DOT_rug_DOT_ac_DOT_be
       http://studwww.rug.ac.be/~gdschrij
---------------------------------------------------------------------------
 "If you pick up a starving dog and make him prosperous, he will not bite you.
 This is the principal difference between a dog and a man." - Mark Twain.



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

Date: 1 Mar 1999 19:38:26 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <7beqbi$7gq$1@info.uah.edu>

In article <x7zp5xdt72.fsf@home.sysarch.com>,
	Uri Guttman <uri@home.sysarch.com> writes:
: speaking of not fair, i have been on most of these lists from time to
: time and under multiple addresses so my real sums were higher than what
: was listed. greg, how about some smarts in the program to count posts by
: my real name instead of my login. i post from both home and work so it
: seems like i am in two places without being anywhere at all.

You can arrange for that to happen automatically by having a Reply-To:
header in all your posts that points to the same address.  You (or
anyone else concerned with this issue) could also send me a list of
addresses from which you post, and I can fix that problem.

Greg
-- 
The power of accurate observation is commonly called cynicism by those who
have not got it. 
    -- George Bernard Shaw


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

Date: Sun, 28 Feb 1999 16:00:56 -0500
From: "J. Daniel Paxton" <paxtond@ix.netcom.com>
Subject: SYNTAX ERROR REVISITED
Message-Id: <36D9AE87.F8461D68@ix.netcom.com>

Hi again...

I am reposting this snippet of code and the resulting syntax error
messages.  In the previous post the code was identified as error free
(more or less).  I have added the one suggestion that I received,
visually rechecked the code, and then had perl check it and I still have
the same syntax error messages (please see below).   Please take another
look and help me see what I am missing.  Thanks.

syntax error in file WPS2.cgi at line 3, next 2 tokens "use DB_File"
Illegal modulus of constant zero in file WPS2.cgi at line 28, next 2
tokens "tim
esleft,"
syntax error in file WPS2.cgi at line 29, next token "or"
syntax error in file WPS2.cgi at line 31, next 2 tokens "exists
$timesleft"
WPS2.cgi had compilation errors.



#!/usr/local/bin/perl -w

use DB_File ;

# Enter the location of sendmail.
$mailprogram = "/usr/lib/sendmail -t";

# Enter the fields that are required.
@required = ('Account_Number','Email_Address','TesteeID','MLR','LLR',);

# Enter your e-mail address.  Be sure to put a \ in front of the @.

$youremail = "paxtond\@ix.netcom.com";

# Put the posted data into variables

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
        ($name, $value) = split(/=/, $pair);
        $value =~ tr/+/ /;
        $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
        $FORM{$name} = $value;
}

# Check for user authorization and decrement

tie %timesleft, "DB_File", "users.dbm", O_RDWR|O_CREAT, 0640, $DB_HASH
        or die "Cannot open file 'users.dbm': $!\n";

if (exists $timesleft{$Account_Number}) {
        $timesleft{$Account_Number}--;
 }
else {
         print "Content-type: text/html\n\n";
                print "<html><head><title>Wrong USER
ID</title></head>\n";
                print "<body><h1>Incorrect Information</h1><br>\n";
                print "I'm sorry, but it would appear that you've made
an error\n";
                print "filling out the $Account_Number field correctly.
Please click\n";
                print "back and try again.\n";
                print "</body></html>\n";
                exit;
        }
if ($timesleft {$Account_Number} <= 0) {
         print "Content-type: text/html\n\n";
                print "<html><head><title>No More
Credit</title></head>\n";
                print "<body><h1>Out of Credit</h1><br>\n";
                print "I'm sorry, but it would appear that you have
used\n";
                print "all available credit for your account.\n";
                print "Please call Michael A. McDaniel. Ph.D. at
804-364-8474 or \n";
        print "email him at McDaniel@Curryinc.com for additional
credit.\n\n";
                print "</body></html>\n";
                exit;
}

untie %timesleft;








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

Date: Mon, 1 Mar 1999 12:26:14 -0000
From: "Antsnio Almeida" <aalmeida@amorim-revestimentos.pt>
Subject: Test file
Message-Id: <7be0jn$phi$1@sagan.global-one.pt>

How can i test the existence of a file ?

Thank you.




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

Date: Sun, 28 Feb 1999 18:40:57 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: The dumbest newbie question ever..?
Message-Id: <36dc8d67.1263769@news.skynet.be>

Andrew M. Langmead wrote:

>>  perl -e "print \"Hello, World\n\";'
>
>That doesn't work under MS-DOS either. Double quotes can't be escaped
>with backslashes. (Or more accurately, can't be escaped.)

Believe it or not, but this DOES work on MS-DOS:

	perl -e "print \"Hello, World\n\";"

	Bart.


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

Date: Mon, 1 Mar 1999 21:31:59 +0200
From: "Marius Avenant" <borama@dockside.co.za>
Subject: Re: The truth about the Pentium III chip and ID --- **boycott info**
Message-Id: <920316723.480157@nntp.dockside.co.za>

Check this one out as well
Received it today in the mail

Pentium III Serial Number Utility
Intel released the Pentium III Serial number control utility which simply
has the function of enabling or disabling the serial number function. You
can download it here:
ftp://download.intel.com/support/processors/pentiumiii/english/ver102.exe



Kano wrote in message <7okC2.5036$r7.6986@newsr2.twcny.rr.com>...
>Oh come on. Many other standard devices (ethernet cards, for example) have
their
>own unique serial numbers that software can use at will. Get over it.
>
>-kl
>





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

Date: 28 Feb 1999 19:04:30 GMT
From: "EvaDooRs" <EvaDooRs@netzero.net>
Subject: Re: This Hostname/IP Convert script is not working
Message-Id: <01be634f$e556f4c0$3eb5edcc@ed>



Sam Holden <sholden@pgrad.cs.usyd.edu.au> wrote in article
<slrn7dhcmf.rbh.sholden@pgrad.cs.usyd.edu.au>...
> 
> A solution would be to read the error message that perl gives and
> rectify it. A simple press of the ~ key should fix it assuming you
> are using vi, if not use whatever key your editor uses.

The error messages are Use of unitialized value at hostent.pm line 41 and
also unititialized value at host.pl on line 10 I rechecked over my spelling
and I can't figure out which values The text editor I'm using is Edit.com
as in dos and perl in dos...so i hope thats enough info for you.

-=EvaDooRs=-


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

Date: Mon, 1 Mar 1999 13:15:42 -0000
From: "Richard Partridge" <r.partridge@dewynters.com>
Subject: URGENT help required!!
Message-Id: <36da9341.0@nnrp1.news.uk.psi.net>


I want my perl script to open a data file on a seperate webserver...
so I thought I could use something like

(filehandle,">> http://www.somewhere.com/cgi-bin/datafile.txt");

Is this legal perl as it doesn't seem to be working for me.....

Regards

Richard

r.partridge@dewnters.com




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

Date: 28 Feb 1999 17:57:38 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Urgent: Help: limit to string size, or...?
Message-Id: <7bc02i$d0$1@gellyfish.btinternet.com>

On Sun, 28 Feb 1999 14:18:43 +0100 soli wrote:
> It is very urgent: I should install this prog until March01 (tomorrow)!
> My boss, you know...
> 

Deadlines, deadlines.  The problem with posting 'Urgent' questions here
is that Usenet is far from real-time - it might take hours for a post to
propagate to all of the servers involved and more hours for a reply to
return to your newshost.  Given that and the fact that you havent actually
supplied enough information for anyone to help you, necessitating a repost
on your part and thus more delay ...

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 28 Feb 1999 12:58:56 -0600
From: "John" <john@terminalreality.com>
Subject: Using Perl to resize image?
Message-Id: <7bc3j3$dpt$1@news.onramp.net>

Is there a way, using Perl or some UNIX program that I can execute through
Perl that I could take a GIF or JPG image and make a thumbnail of it at a
size that I specify?

My system is a LINUX box running Apache and Perl 5 with MySQL and the DBI
Perl module.

If you reply to this message to the newsgroup could you please also email me
at john@terminalreality.com

Thanks for any help provided!

John




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

Date: 28 Feb 1999 21:43:46 +0100
From: Pascal Rigaux <pixel_@geocities.com>
Subject: Re: Using Perl to resize image?
Message-Id: <4wu2w6mf7h.fsf@dre2.polytechnique.fr>

try convert of ImageMagick


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

Date: Mon, 01 Mar 1999 13:48:08 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
Subject: Re: using the perl open function
Message-Id: <36DAE0E8.AEA7208C@giss.nasa.gov>

Larry Rosler wrote:
> 
> > > open (WR, ">$DIR\\reg.htm");
> >
> > open WR, ">$DIR\\reg.htm" || die "can't open file: $!";
> 
> No error will be reported if the 'open' fails, because the precedences
> are wrong.  Use 'or', or put parens around the arguments to 'open'.

oops!  sorry, I personally always use "or" in such a situation.
I just wasn't sure whether that keyword was defined in Perl4.

--  
Q: "are variables local by default when used in a foreach loop?"
A: "Yes, sometimes, if there's no lexical in scope.
    But then it's a local, which is really a global.
    This is all explained in the perlsyn manpage."

	-- Tom Christiansen, in 36c9b5d3@csnews


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

Date: Sun, 28 Feb 1999 18:31:49 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Why isn't this a race condition ?
Message-Id: <36da8b5b.807562@news.skynet.be>

Juho Cederstrvm wrote:

>    sysopen(FH, "numfile", O_RDWR|O_CREAT, 0644) or die "can't open numfile:
>$!";
>    flock(FH, 2)      or die "can't flock numfile: $!";

The second line waits until it can have the lock. That may mean, wait
until another process closes (and unlocks) the file.

	Bart.


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

Date: 12 Dec 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 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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