[7790] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1415 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 5 10:08:57 1997

Date: Fri, 5 Dec 97 07:00:39 -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           Fri, 5 Dec 1997     Volume: 8 Number: 1415

Today's topics:
     Re: 001 + 1 = 002; 002 - 1 = 1 ARGH <mcohen@netaxs.com>
     Browser redirect in CGI? <bgodden@imap1.apple.com>
     Re: Browser redirect in CGI? <zenin@best.com>
     Re: Browser redirect in CGI? (brian d foy)
     Re: help for a perl beginner! (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
     Re: help for a perl beginner! , snailgem@aol.com
     Re: help for a perl beginner! (Martien Verbruggen)
     Re: looking for script like guestbook, boards , etc. (Martien Verbruggen)
     Re: Modifying an array which has been passed in by name (sysadmin)
     Re: Newbie question.   Do you recommend moving from C? <jssmith1@flash.net>
     Re: Newbie question.   Do you recommend moving from C? <pvhp@forte.com>
     Re: newer than new to perl <cjlf@netcom.com>
     Re: Pattern matching (or not....) (Abigail)
     Perl 5.004_04 year 2000 compliant? (Thomas Munn)
     Re: Perl 5.004_04 year 2000 compliant? <zenin@best.com>
     Re: Perl 5.004_04 year 2000 compliant? (brian d foy)
     Re: Perl Contractors Wanted (Martien Verbruggen)
     Re: Perl editor needed <cjlf@netcom.com>
     Re: Please help again :( forget to attach the file (Gabor)
     Re: Q: lambda fun, loop, string to expr (Ilya Zakharevich)
     Re: Question for people who know perl&html <zenin@best.com>
     Re: RESOURCE KIT ANOMALY... ONE MORE TIME lvirden@cas.org
     Re: RESOURCE KIT ANOMALY... ONE MORE TIME (Nathan V. Patwardhan)
     Re: Rounding functions for perl? <sherlock.holmes@worldnet.att.net>
     Re: Seems to be just another  5.004_* bug:-( (Vladimir Sovetov)
     Re: Seems to be just another  5.004_* bug:-( (Ilya Zakharevich)
     Re: some good perl-sites <jeff@webdesigns1.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 03 Dec 1997 20:22:39 -0500
From: Martin Cohen <mcohen@netaxs.com>
Subject: Re: 001 + 1 = 002; 002 - 1 = 1 ARGH
Message-Id: <348605DF.DD3@netaxs.com>

Just keep the number numeric and generate the file name with sprintf.

	$filename=sprintf "file.%03d", $ext;

where $ext is the integer you are updating, representing the file
extension.
--
Marty Cohen

Roy S. Rapoport wrote:
> 
> Gosh, was that clear enough? :)
> 
> I'm trying to do a log rotation program that takes as one of its args the
> type of suffix you should have on the file.  For example, if given 001, it
> should then rotate files to
> file -> file.001
> file.001 -> file.002
> 
> etc.
> 
> Now, going up is great -- Perl is wonderful in doing 'the right thing' (I think
> it's the right thing, at least) and, when given 001 + 1, returning 002.
> 
> The problem is that I haven't found a way to do 002 - 1 = 001.  In other words,
> given
> 
> $a = "001" ;
> $a++ ;
> 
> $a is now equal to "002"; but if I now do
> $a-- ;
> $a is now equal to 1!
> 
> Any way around it?
> 
> -roy

-- 
Martin Cohen, 900 Valley Rd #D203, Melrose Park, PA 19027-3228,
mcohen@acm.org


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

Date: Wed, 03 Dec 1997 15:45:01 -0800
From: Brian Godden <bgodden@imap1.apple.com>
Subject: Browser redirect in CGI?
Message-Id: <3485EEFA.6029D2F1@imap1.apple.com>

Hello all,

I have a simple question.  I'm trying to do a browser redirect after a
successful form submittion.  I found a reference that recommended this:

print "Location: http://blah.com/page.html\n\n";

But this only prints this statement to my browser.  Any suggestions why
this doesn't work?  Or suggestion on how to do this better?  Would some
form of open work better?

Thanks!

Brian Godden




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

Date: 4 Dec 1997 01:35:56 GMT
From: Zenin <zenin@best.com>
Subject: Re: Browser redirect in CGI?
Message-Id: <881199524.863156@thrush.omix.com>

[ posted, mailed, and followups redirected to the group below... ]

Brian Godden <bgodden@imap1.apple.com> wrote:
	>snip<

	comp.infosystems.www.authoring.cgi

-- 
-Zenin
 zenin@best.com


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

Date: Wed, 03 Dec 1997 20:51:27 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Browser redirect in CGI?
Message-Id: <comdog-ya02408000R0312972051270001@news.panix.com>

In article <3485EEFA.6029D2F1@imap1.apple.com>, bgodden@apple.com wrote:

>I have a simple question.  I'm trying to do a browser redirect after a
>successful form submittion.  I found a reference that recommended this:
>
>print "Location: http://blah.com/page.html\n\n";

that statement alone is fine as far as Perl goes, so your problem is
something other than Perl.

since that message prints in the broswer window, my guess would be that
you already output an HTTP header without realizing it.  you can see
everything that your browser sends out by using HTTPeek [1].  if you
see an extra "Content-type" at the top of the response, then you 
need to remoce that from your program.

good luck :)

[1] <URL:http://computerdog.com/httpeek>

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Wed, 03 Dec 97 20:28:20 -0500
From: bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Subject: Re: help for a perl beginner!
Message-Id: <34860775$11$ofn$mr2ice@speaker>

In <663q6b$nsl@bgtnsc01.worldnet.att.net>, on 12/03/97 at 06:26 AM,
   "Creede Lambard" <$_=qq!fearless@NOSPAMio.com!;y/A-Z//d;print> said: +-----
| perl -i.bak -e"s/\r//g" filename
| What this does (it's untested but it should work)
+--->8

You really should know better than that (then again, so should I! :-) --- from
the command line you've one too few backslashes and it will delete every "r"
in the input file.

-- 
sub AUTOLOAD{print$_{$_.++$x{$_}}}sub new{my%x;%_=map{++$a%2?$_.++$x{$_}:$_}
split(//,pack('N*',unpack('w*',unpack('u*','M@H*HP\'2"@\C`88+SE/!EA(F!A\'6'.
"\$LZV0+(3;C9QRA9NAPG2&D\\G(88:KL=A0\n4AN.5W\"\"&\\[W>;H>3S>0@A\\N@PB\$`")
)));bless{}}$b=new main;map{$b->_}split(//,' Brandon S. Allbery KF8NH');#:-)


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

Date: Wed, 03 Dec 1997 21:35:02 -0500
From: , snailgem@aol.com
Subject: Re: help for a perl beginner!
Message-Id: <348616D3.4199@aol.com>

> 1. I (and most others) suggest you use "chomp" instead of "chop" to
> delete the newline from your input. It's safer.
> 


Why is that?
Most of the code I read (even on this newgroup) uses 'chop'.

Thanks.


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

Date: 4 Dec 1997 02:03:37 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: help for a perl beginner!
Message-Id: <66531p$5hu$3@comdyn.comdyn.com.au>

In article <3484FE0E.B53EE7D1@isu.edu>,
	Joe Ng <ngyat@isu.edu> writes:

> #!/usr/bin/perl

Always run perl with the -w flag.

> # this is a program that removes all the "\r" from a file.

I don't think so.

> print "Input a file name:";
> $infilename=<STDIN>;
> chop ($infilename);

chomp is safer;

> open(MYFILE, $infilename);

Always check the return value from open. What happens if the file
doesn't exist?

open(MYFILE, $infilename) or die "Cannot open $infilename for reading :$!";

> print "Type output file name:";
> $outfilename=<STDIN>;
> chop ($outfilename);
> $outfilename =~ s/^/>/;

I wouldn't do this. Better leave $outfilename alone, and do it in the
open:

> open(MYOUTFILE,$outfilename);

See above:

open(MYOUTFILE, ">$outfilename") 
	or die "Cannot open $outfilename for writing :$!";

> close (MYINFILE);
> close (MYOUTFILE);

So.. where do you read the contents of MYFILE and write the
output to MYOUTFILE? You open them, but you don't wo anything with
them.

You will need a few of the <MYFILE> and printf MYOUTFILE something
lines in there.

HTH
Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Very funny Scotty, now beam down my
Commercial Dynamics Pty. Ltd.       | clothes.
NSW, Australia                      | 


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

Date: 4 Dec 1997 01:50:42 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: looking for script like guestbook, boards , etc.
Message-Id: <66529i$5hu$1@comdyn.comdyn.com.au>

In article <661kqo$pqd@news1.pld.com>,
	"Matthew Wagley" <rudedog@pld.com> writes:
> I am looking for scripts to allow people to use them on there web pages.
> Remotely hosted cgi stuff.   So i can provide that service.
> Anybody know where those kind of scripts are?

You should be asking this on a CGI newsgroup, not here. Next time,
please try one of the comp.infosystems.www.* groups.

In the meantime, try www.cgi-resources.com

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | In a world without fences, who needs
Commercial Dynamics Pty. Ltd.       | Gates?
NSW, Australia                      | 


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

Date: 4 Dec 1997 00:52:57 GMT
From: nobody@nowhere.com (sysadmin)
Subject: Re: Modifying an array which has been passed in by name ...
Message-Id: <664ut9$8du@newsserver.trl.OZ.AU>


Anish Moni gesticulated wildly:

>>Hi Perl gurus,

More of a (perl) apprentice rather than guru, but:

>>
>>I have another question for you. If I have a program whihc is something
 like 
>>this

, it won't work because the variables are wrong :-).

>>
>>@Foo = (1,2);
>>&Modify (*foo);

&Modify (*Foo);
print $foo[0], "\n";
print $foo[1], "\n";

>>
>>sub Modify {
>>        local (*Copy1OfFoo) = @_;
>>        &ModifyFurther (*CopyOfFoo);

&ModifyFurther (*Copy1OfFoo);

>>}
>>
>>sub ModifyFurther {
>>        local (*Copy2OfFoo) = @_;
>>        $Copy2OfFoo[0] = 3;        // causes problems

$Copy2OfFoo[0] = 3;

>>}
>>
>>Now when I try this program I get an error. The interpretor tells me that
 I am 
>>trying to modify a read only value at the line. What am I doing wrong? Is
 this 
>>possible at all? What I want to be able to do is try and modify $Foo in 
>>ModifyFurther without making the function rely on the name of the array. 

Hmm!! The only error I got was the complaint about the '//' comment, but
 this was tested at work on the brain-dead Perl4.  Not sure if this is
 valid on Perl5.

With the mods and the prints, it indeed outputs "3\n2\n" as expected.



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

Date: 4 Dec 1997 01:37:30 GMT
From: "Jason Smith" <jssmith1@flash.net>
Subject: Re: Newbie question.   Do you recommend moving from C?
Message-Id: <01bd0055$c762c100$bf241ed1@jason-smith>

At the risk of being flamed by those Microsoft haters out there (and I
agree there is some just cause for hating Microsoft these days), I would
recommend that if you are developing for the PC platform only, and all your
users are on Windows 95 or Windows NT, a good choice (for the moment) is
Visual Basic 5.  It isn't perfect by any means, but it is usable, and with
proper testing you can make reliable, maybe even robust, applications using
it.  

At this point, I am just learning Java. In a year or so, it will probably
get my vote.  If you want to start learning it now, bully for you.  I would
recommend Borland's JBuilder at the moment.  It is still a little
primitive, but it shows enormous potential as a VB-like RAD development
tool for Java (I just LOVE RAD development).  Hint:  get the education
edition if you can.  It's only $100.  

Right now, there are only a few Java development environments that are
sufficiently stable for serious development work, and then only for server
side applications.  At least that is my understanding.  The transition to
Java 1.1 is under way, 1.2 is just around the corner, and 2.0 is slated for
sometime next year.  During this time, it will be difficult to write once
and run anywhere at all, at least not without testing your app on a dozen
different browsers.  Also, the vendors do not seem to be updating the old
browsers to run the newer Java VMs, so you have to wait for your user base
to catch up as well.

HOWEVER, once things settle down a bit, Java will be great.  I have seen
many development systems go from infancy to maturity, and Java is still in
the infancy stage (but a very beautiful baby).  It is built on a very solid
foundation of knowledge developed over the last 50 years, and Sun is doing
a great job of marketing it.  Once it gets to the maturity stage, look for
Java Virtual Machines (with next generation compilers) that run as fast
(well, almost) as C++.  Also, look for the demise of memory leaks - and
pointers to nowhere - so prevalent in C++ applications today.  For all you
guys out there who never make any mistakes in your programs, this will make
no difference.  To guys like me who hate spending late nights tracking down
an "error of 1," this makes all the difference in the world.  

It will never run on all the operating systems out there (especially all
the older versions still hanging around), but I suspect it will run on
enough systems that it will be considered the most universal language
available.  This is in contrast to VB, which only runs well on Windows
systems (Microsoft has released the VB VM specs and code, but don't expect
any performance on other operating systems - or support from Microsoft).  

In fact ***MICROSOFT BASH ALERT*** if Microsoft doesn't start supporting
other systems with its development tools, it could end up losing a lot of
market share.  Time to sell your Microsoft stock and buy Borland and
Semantec?  
  
Nikki Locke <nikki@trmphrst.demon.co.uk> wrote in article
<VA.000003b4.00ad3dfb@trmphrst.demon.co.uk>...
> In article <347C5CAC.6C29@mb.sympatico.ca>, Programming wrote:
> > I have been experiencing 
> > "the joy of C" the past few months. 
> > ... 



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

Date: Wed, 03 Dec 1997 20:33:17 -0800
From: Peter Prymmer <pvhp@forte.com>
To: lvirden@cas.org
Subject: Re: Newbie question.   Do you recommend moving from C?
Message-Id: <3486328D.1A77@forte.com>

lvirden@cas.org wrote:
> According to Programming  <sysdev@mb.sympatico.ca>:
> :So, what would be 2 statements in say Visual Basic,
> 
> :Yet, the supposed advantage of C is that it is,
> :get this, compact!   Imagine Oracle making
> 
> I wonder in what language Visual Basic is written?  C or C++?

An outgrowth of Bill Gates and Paul Allen's original Microsoft BASIC for
CP/M it seems quite likely that there would still be core parts written
in 80x86 assembler.  It seems like most MS code these days though is
written in C++, but that is only speculation on my part.

Peter Prymmer


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

Date: Thu, 4 Dec 1997 01:21:18 GMT
From: Kent Scheidegger <cjlf@netcom.com>
Subject: Re: newer than new to perl
Message-Id: <cjlfEKn53I.50L@netcom.com>

Luu Tran <luu_tran@geocities.com> wrote:

: You can't run in in DOS mode; you have to run it in a DOS prompt (there's a 
: difference).  Select Start | Run and enter c:\command.  That should give 
: you a window with a C:\ prompt.  cd to your perl and and run it as you did 
: before.

  That works, but it is the hard way.  Press the "Start" button, then choose
"Programs" and one of the options should be "MS-DOS prompt".  Selecting that
one puts you in a command-line environment, although you're still actually
in Win95.  Type "exit" to return to the graphical user interface (i.e.
regular Windows).

  Easier still, copy the MS-DOS prompt shortcut to your desktop.  I have it
there, and frequently drop into the command line environment to do any of
the many, many things that command line does better, easier, and faster than
the GUI.


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

Date: 4 Dec 1997 00:41:44 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Pattern matching (or not....)
Message-Id: <slrn68bv5k.175.abigail@betelgeuse.wayne.fnx.com>

Martien Verbruggen (mgjv@comdyn.com.au) wrote on 1555 September 1993 in
<URL: news:664hop$4cs$1@comdyn.comdyn.com.au>:
++ In article <662hh1$2iu$1@comdyn.comdyn.com.au>,
++ 	mgjv@comdyn.com.au (Martien Verbruggen) writes:
++ 
++ 
++ Whoops,
++ 
++ Of course, you need to upgrade to perl5 for the \Q\E to work... Since
++ you mentioned that that is not possible (Are they also using 5 year
++ old versions of operating systems and compilers?), you're stuck with
++ one of the other two solutions.

How about installing perl5 somewhere else, and use:

    $var = `/path/to/perl5 -e "...."`; 


Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


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

Date: Thu, 04 Dec 1997 00:16:34 GMT
From: munn@bigfoot.com (Thomas Munn)
Subject: Perl 5.004_04 year 2000 compliant?
Message-Id: <664sor$bq3@nnrp1.farm.idt.net>

I was wondering if PERL 5.004_04 is year 2000 compliant?? And if so, are there 
any nice, authoritative and high sounding documents that will impress 
management types available saying that it is?? (A url would be nice!)

Thanks,

Thomas


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

Date: 4 Dec 1997 01:31:50 GMT
From: Zenin <zenin@best.com>
Subject: Re: Perl 5.004_04 year 2000 compliant?
Message-Id: <881199278.354322@thrush.omix.com>

[ posted & mailed ]

Thomas Munn <munn@bigfoot.com> wrote:
: I was wondering if PERL 5.004_04 is year 2000 compliant?? And if so, are there 
: any nice, authoritative and high sounding documents that will impress 
: management types available saying that it is?? (A url would be nice!)

	RTFFAQ

	man perlfaq4

	And search for "2000"...  It might impress the management types more
	if you could show that you even _tried_ to read the docs first...

	:-/

-- 
-Zenin
 zenin@best.com


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

Date: Wed, 03 Dec 1997 20:58:03 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Perl 5.004_04 year 2000 compliant?
Message-Id: <comdog-ya02408000R0312972058030001@news.panix.com>

In article <664sor$bq3@nnrp1.farm.idt.net>, munn@bigfoot.com (Thomas Munn) wrote:

>I was wondering if PERL 5.004_04 is year 2000 compliant?? And if so, are there 
>any nice, authoritative and high sounding documents that will impress 
>management types available saying that it is?? (A url would be nice!)

you can impress the management types by checking whether or not
your coders are year 2000 compliant since "compliant" tools can since
produce bad code given a bad coder.

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: 4 Dec 1997 01:56:32 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl Contractors Wanted
Message-Id: <6652kg$5hu$2@comdyn.comdyn.com.au>

In article <348470CE.13D5FA40@martech.pageactive.com>,
	Peter Marshall <peterm@martech.pageactive.com> writes:

> We are looking for Perl Contractors.

Perl?

> - we are Perl savy, you will not have to deal Perl wannabes

savy?
wannabes?
deal Perl?

> - you are one two types (yes there are more types) 

more than 'one two types'? 'four eight type'?

>    b) you like to be invovled from start contribute to the
> creative solution

invovled from start contribute?

> DONOT POST REPLY Email to peterm@pageactive.com or call the
> number below.

Gosh, you guys sound professional. I am too intimidated to reply now..
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Very funny Scotty, now beam down my
Commercial Dynamics Pty. Ltd.       | clothes.
NSW, Australia                      | 


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

Date: Thu, 4 Dec 1997 01:28:05 GMT
From: Kent Scheidegger <cjlf@netcom.com>
Subject: Re: Perl editor needed
Message-Id: <cjlfEKn5Et.5AK@netcom.com>

Bill Guindon <billg@networkapparel.com> wrote:

: Larry Hanlon wrote:
: > 
: > Hello, just found first lesson in PERL. I need to find a editor that doesn't
: > add a CR to the end of each line. What I am doing is the programming in a
: > WIN95/DOS environment and when the scripts are run on a UNIX platform the
: > CR's create errors. Please reply to e-mail as the news server is sometimes
: > buggy.

  I just go ahead and upload them to the Unix system, CR's and all.  Once
there, the command

flip -u foo.pl

strips off the CR's.


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

Date: 4 Dec 1997 03:38:20 GMT
From: gabor@vinyl.quickweb.com (Gabor)
Subject: Re: Please help again :( forget to attach the file
Message-Id: <slrn68c925.65d.gabor@vinyl.quickweb.com>

In article <01bd0010$4a91fc80$2d0d63cf@default>, Ahmet Ayvaz wrote:
>Can somebody tell me what the problem is with this script. It's
>very simple, but I keep getting an internal server error when I try to
>run it. I've set all the permissions right so that isn't it and I FTP'd the
>file in ASCII mode.
>
>My web hosting service won't help either(I'll be moving my sites soon).
>
>Thanks in advance for all you help!
>
>P.S. The script is attached. named example1.pl (copied from book).
>
>Best regards,
>Ahmet Ayvaz
>ayvaz@weborigins.com
>
>begin 600 example1.pl
>M(R$O=7-R+VQO8V%L+V)I;B]P97)L( T*(V5X86UP;&4Q+G!L#0H-"FEF("@D
>M14Y6>R=215%515-47TU%5$A/1"=](&5Q("=03U-4)RD-"GL-"G)E860H4U1$

[snip the rest]

Yeah it is either extremely obfuscated code or it's encoded.  Some
people can read obfuscated code but nobody can read encoded stuff.
Post it in human readable form. ;-)

gabor.
--
    3 syncs represent the trinity - init, the child and the eternal
    zombie process.
        -- Jordan K. Hubbard
mharris@gov.on.ca he, he, he


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

Date: 4 Dec 1997 01:05:57 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Q: lambda fun, loop, string to expr
Message-Id: <664vll$hp9$1@agate.berkeley.edu>

In article <3485e811$10$ofn$mr2ice@speaker>,
Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh" <bsa@void.apk.net> wrote:
> In <664fh2$8f9$1@agate.berkeley.edu>, on 12/03/97 at 08:30 PM,
>    ilya@math.ohio-state.edu (Ilya Zakharevich) said:
> +-----
> | This ain't no subroutine.  It is made to look very close, but it is just a
> | BLOCK, which is slightly different (say, try to use `return' there).
> > ( . . . )

[Important part to which the following sequence is refering skipped in
 the origignal.]

> | This ain't no bug, but is very close to be one.
> +--->8
> 
> I wouldn't call it a bug, but I'd say that it's lagging behind the rest of
> Perl --- after all, anonymous subs (i.e. "$a = sub { ... }") are a relatively
> recent addition compared to "sort { ... } ...".

Quite the opposite, it is going ahead of the rest of Perl, where you
cannot call a chunk of code without an *enourmous* overhead.

Ilya


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

Date: 4 Dec 1997 01:25:57 GMT
From: Zenin <zenin@best.com>
Subject: Re: Question for people who know perl&html
Message-Id: <881198925.922894@thrush.omix.com>

yong_huang@fmc.com wrote:
: For people who know both Perl and HTML, how can I read input from a file 
: on the browser machine? In the Perl script on the server, I want to say 
: something like open(PRNTRLST, "printerlist") or die "Can't read: $!", 
: where printerlist is a file on the browser machine, not on the server. 

	You can not do this, except maybe if the user is using MSIE.

	j/k...maybe :-)

: (Accessing this site needs building that file manually). I know in HTML 
: you can say <a href="file:///usr/local/bin/printerlist>my printer list
: </a> to open the local file. But how can I get the content of this file 
: into the server side Perl script? Thanks for advice.

	You'll have to have them submit it with an <INPUT TYPE="file">
	option.  The CGI.pm module is your easiest route to handling this
	type of form input.

-- 
-Zenin
 zenin@best.com


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

Date: 4 Dec 1997 02:48:08 GMT
From: lvirden@cas.org
Subject: Re: RESOURCE KIT ANOMALY... ONE MORE TIME
Message-Id: <6655l8$ltq$1@srv38s4u.cas.org>


According to Nathan V. Patwardhan <nvp@shore.net>:
:Phil Houstoun (pjhousto@cse.dnd.ca) wrote:
:
:If I recall correctly, the PRK setup tool uses the CPAN module.  The
:CPAN module can't handle compressed files, although it can handle
:gzipped files (CPAN::Config uses gzip, not compress) -- I believe that

Strange - gzip handles compressed files just fine 

$ gzip -c -d test.Z | wc -l
      30

$ zcat test.Z | wc -l
      30



-- 
Larry W. Virden                 INET: lvirden@cas.org
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.


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

Date: 4 Dec 1997 03:07:08 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: RESOURCE KIT ANOMALY... ONE MORE TIME
Message-Id: <6656os$8rt@fridge.shore.net>

lvirden@cas.org wrote:

: Strange - gzip handles compressed files just fine 
[snip]

Actually, 'gzip -d' wasn't the problem (or more appropriately -- the
solution).  I didn't have any success with earlier versions of CPAN.pm
(prior to 5.004_04 release of Perl) when I used it.  Seems to work fine
now with or without -d.

The problem was that CPAN.pm couldn't find CHECKSUM or CHECKSUM.gz, so
it got confused when it encountered CHECKSUM.Z.

--
Nathan V. Patwardhan
please don't spam pres@whitehouse.gov


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

Date: Wed, 3 Dec 1997 19:52:40 -0500
From: "Alan Fahrner" <sherlock.holmes@worldnet.att.net>
Subject: Re: Rounding functions for perl?
Message-Id: <664v6h$n25@mtinsc03.worldnet.att.net>


brian d foy wrote in message ...
(reacting to):
>>sprintf does round.  At least it does for me. =)
>
>my mistake - it's even documented that way in the printf man page.  i'm
>not sure it is like this on all systems though.  if you depend on
>rounded numbers you should make sure that everything operates as
>you expect.  i've never relied on printf to do this for me :)
I haven't been able to depend on the rounding either (I ended up writing a
function to do it)

Glad to share it if anyone wants it (it's fairly simple)...

My best...

Alan




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

Date: 4 Dec 1997 04:38:10 GMT
From: sova@kpbank.ru (Vladimir Sovetov)
Subject: Re: Seems to be just another  5.004_* bug:-(
Message-Id: <665c3i$kg4$2@home.kpbank.ru>

Tom Phoenix (rootbeer@teleport.com) wrote:
: On 1 Dec 1997, Vladimir Sovetov wrote:

: >                    s/<(?:[^>'"]+|(['"]).+?\1)*>//gs;

: >   Yes!! It's dumb all over:-)) and incorrect, but it shouldn't hang-up
: >  from my point of view in any case!

: It doesn't hang; it merely takes a few million seconds to do what you've
: asked. :-)   See the hip owls book ("Mastering Regular Expressions") to
: see what's gone wrong and how to fix it. Good luck!
     Well, anyway I don't like that this little thing

	 s/<([^>]+)*>//;

   could hang-up your script now under 5.004_04.
---
Vladimir Sovetov | Kuzbassprombank


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

Date: 4 Dec 1997 04:52:50 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Seems to be just another  5.004_* bug:-(
Message-Id: <665cv2$o17$1@agate.berkeley.edu>

In article <665c3i$kg4$2@home.kpbank.ru>,
Vladimir Sovetov <sova@kpbank.ru> wrote:
>      Well, anyway I don't like that this little thing
> 
> 	 s/<([^>]+)*>//;
> 
>    could hang-up your script now under 5.004_04.

Do you try to infer that the older versions would not do it?!  This is
a well-known limitation of NFA engines.  As far as Perl remains 100%
NFA (hopefully, not so long now), this will remain as always was.

And this is not a hang-up.  It is no more than

	1 while $i++ < 1e9;

Ilya


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

Date: Wed, 3 Dec 1997 09:20:49 -0600
From: "Jeff Oien" <jeff@webdesigns1.com>
Subject: Re: some good perl-sites
Message-Id: <663t4j$36j@newsops.execpc.com>

I have a site called Perl Primer which may be of help.
http://www.webdesigns1.com/perl/
--
Jeff Oien, WebDesigns
http://www.webdesigns1.com/

>>I'm learning perl and I'd like to know if there are any good
>>tutorials and FAQ's etc..

>>If you know any good sites.. Please mail me or post it in the
>>group.





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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>


Administrivia:

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

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