[12818] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 228 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 22 16:07:30 1999

Date: Thu, 22 Jul 1999 13:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 22 Jul 1999     Volume: 9 Number: 228

Today's topics:
    Re: a bit of a bind.. <keithmur@mindspring.com>
    Re: a bit of a bind.. <tchrist@mox.perl.com>
    Re: basename regexp? (Anno Siegel)
    Re: Brain Dead & Parsing (Steve van der Burg)
    Re: concatenate <pagib@aur.alcatel.com>
    Re: doing an ls in PERL (globbing) <pagib@aur.alcatel.com>
        exporting database table to text <spnaraya@collins.rockwell.com>
    Re: finding last created files in a directory (Anno Siegel)
        Geekspeak Programming Contest <tchrist@mox.perl.com>
    Re: Help me ..; databases ... <mlopresti@bigfoot.com>
    Re: Help using GET to pull down and HTML document. (brian d foy)
    Re: index.cgi script help (brian d foy)
    Re: LWP and PUT (brian d foy)
    Re: Need Help with Virtual Avenue (brian d foy)
    Re: Perl Compiler?? <tchrist@mox.perl.com>
        Perl Power Tools (PPT): get rid of other shells ? <pagib@aur.alcatel.com>
    Re: PGP and Mail (brian d foy)
    Re: Returning file handle from a subroutine (Anno Siegel)
    Re: RFC 1867, file upload skao@my-deja.com
    Re: TPJ/Earthweb junk mail? <macintsh@cs.bu.edu>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Thu, 22 Jul 1999 14:08:42 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: a bit of a bind..
Message-Id: <37976C3A.D5764EE2@mindspring.com>

Tom Christiansen wrote:
> 
>      [courtesy cc of this posting mailed to cited author]
> 
> In comp.lang.perl.misc,
>     aml@world.std.com (Andrew M. Langmead) writes:
> :Another would be to use the IO:File module and store the IO::File
> :object in a lexically local scalar:
> :
> :sub sub_1 {
> :   my $file;
> :   $file = IO::File->new('file') or warn "Error opening file: $!\n";
> 
> Which is pretty much just a nasty and slow way of writing it in
> 100% Pure Perl.  I'd be more apt to do something like this:
> 
>     my $fh = do { local *FH };
>     open($fh, $filename) || die "can't open $filename: $!";
> 
Why the extra level of indirection?  What's wrong with:

	my $fh = local *FH;
	open($fh, $filename) || die "can't open $filename: $!";


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

Date: 22 Jul 1999 13:20:09 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: a bit of a bind..
Message-Id: <37976ee9@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    keithmur@mindspring.com writes:
:Why the extra level of indirection?  What's wrong with:
:	my $fh = local *FH;
:	open($fh, $filename) || die "can't open $filename: $!";

Well, what if you want to make two of them?  Or what if you want to call
a function named &FH?  Or what if you want to call a function that wants
to call a function named &FH?

--tom
-- 
Besides, including <std_ice_cubes.h> is a fatal error on machines that
don't have it yet.  Bad language design, there...  :-)
        --Larry Wall in <1991Aug22.220929.6857@netlabs.com>


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

Date: 22 Jul 1999 19:30:09 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: basename regexp?
Message-Id: <7n7rg1$v00$1@lublin.zrz.tu-berlin.de>

Bart Lateur <bart.lateur@skynet.be> wrote in comp.lang.perl.misc:
>Andreas Fehr wrote:
>
>>>Change it to:
>>>
>>>m/([^\\\/]+)$/;
>>>
>>>This covers / and \
>>>
>>
>>No MacPerl here :(
>>I don't know its delimiter.
>
>The colon. Hey, that's special in DOS too.
>
>	/([^\\\/:]+)$/;
>
>But I like
>
>	($dir,$basename) = /(.*[\\\/:])(.*)/;

I'm not sure how serious all this still is, but this is of course
*not* a portable way to separate a directory name from a filename.
"a:b" is a legal filename in unix, as is "a/b" in macos, and so on.

Anno


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

Date: 22 Jul 1999 19:33:12 GMT
From: steve.vanderburg@lhsc.on.ca (Steve van der Burg)
Subject: Re: Brain Dead & Parsing
Message-Id: <8E0B9E377stevevanderburglhsco@newshost.uwo.ca>

andy@advdata.net (Andy) wrote in <932666299.310902@nntp.adni.net>:
>
>I am trying to parse documents for my company from a remote web site. I am
>just using lynx to get the source then store it in an array.
>
>I am trying to search for a certain word like Current:
>once it finds current it will print the next 5 lines that have href tags on
>it
>or
>once it finds current. If will go until it hits the next word it is
>searching for like Archive.

How about this -- it should get you at least part of the way there, and can be 
added to until it's exactly what you need.  Read the manpage for HTML::Parser 
for more information.  I haven't paid too much attention to what you actually 
need to pull from the page, so this code just grabs up to 5 anchor containers 
between "Current:" and "Archive:".  Since it's just a quick cut and paste job 
from some of my own code, it may contain an error or two, but the basic idea is 
there.

 ...Steve


*** start of sample code ***

#!/bin/perl
#
# Extract interesting things from web pages
#

# Subclass HTML::Parser and do useful stuff with it:
#
package MyParser;

use HTML::Parser;
use strict;
use vars qw / @ISA /;

@ISA = qw(HTML::Parser);

sub declaration {}
sub comment {}

sub start {
   my ($self,$tag,$attr,$attrseq,$origtext) = @_;
   return unless $self->{interested};

   $self->{in_anchor} = 1 if $tag eq 'a';
   return unless $self->{in_anchor};

   $self->{acount}++;
   $self->{saved} .= $origtext;
}

sub end {
   my ($self,$tag,$origtext) = @_;

   $self->{saved} .= $origtext if $self->{in_anchor} && $self->{interested};
   $self->{in_anchor} = 0 if $tag eq 'a';
   return;
}

sub text {
   my ($self,$text) = @_;
   $self->{interested} = 1 if $text =~ /Current:/;
   $self->{interested} = 0 if $self->{acount} > 5 || $text =~ /Archive:/;
   $self->{saved} .= $text if $self->{in_anchor} && $self->{interested};
}

sub out { return $_[0]->{saved}; }

#---------------------------------------------------------------------

package main;

use LWP::UserAgent;

use strict;

# Could use LWP::Simple here...
#
my $url = 'http://something....';
my $ua  = new LWP::UserAgent;
my $res = $ua->request(HTTP::Request->new(GET => $url));

exit unless $res->is_success;

my $doc = $res->content;

# Parse and extract what you want:
#
my $w = MyParser->new();
$w->parse($doc);
$w->eof;

print $w->out;

*** end of sample code ***

-- 
Steve van der Burg
Technical Analyst, Information Services
London Health Sciences Centre
London, Ontario, Canada
Email: steve.vanderburg@lhsc.on.ca


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

Date: Thu, 22 Jul 1999 14:00:40 -0500
From: Bruno Pagis <pagib@aur.alcatel.com>
To: Dow <primus3@ix.netcom.com>
Subject: Re: concatenate
Message-Id: <37977868.C92BF625@aur.alcatel.com>

$ string3 = $string1 . $string2;

BRUNO.

Dow wrote:
> 
> How do you concatenate two strings together?
> Like
> $string1 = '/dir/dir2/';
> $string2 = 'dir3';
> and I want
> $string3 = '/dir1/dir2/dir3/';
you meant '/dir/dir2/dir3/' right ?
> thanks if anyone can help I'd be a really happy girl!


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

Date: Thu, 22 Jul 1999 14:03:05 -0500
From: Bruno Pagis <pagib@aur.alcatel.com>
To: Dow <primus3@ix.netcom.com>
Subject: Re: doing an ls in PERL (globbing)
Message-Id: <379778F9.912D8081@aur.alcatel.com>

If you don't mind using existing code, see
http://language.perl.com/ppt/src/ls/index.html
from Tom Christiansen's PPT (Perl Power Tools).

BRUNO.

Dow wrote:
> 
> I'm trying to do the UNIX command - ls - in PERL script
> what I orginally was doing was globbing by assigning a directory to an
> array :
> 
> @directory = </some/path/name/>
> 
> #Then I walked thru the array:
> foreach $i (@directory){
>         #here is where my problem is:
>         @directory2 = <$i>;
>         # I tried to create another glob but it won't work
>         # I think it's because $i = 'some var'; and
>         # some var is in single quotes.  I know that you can't
>         # do a glob in quotes at all!  How do I remedy this or
>         # is there a completely different way of doing this?
> }
> 
> Thanks a million ;-)
> -Linda


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

Date: Thu, 22 Jul 1999 14:14:32 -0500
From: Sriram Narayanan <spnaraya@collins.rockwell.com>
Subject: exporting database table to text
Message-Id: <37976D97.C957792@collins.rockwell.com>

i would like to export a ms access table to text with a header and
footer.  ideally, the header would have the name of the table and date
and the footer would have the number of records in the table..is perl
the way to go? (i'm a newbie) if so, where do i start?
a billion thanks in advance..




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

Date: 22 Jul 1999 19:13:43 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: finding last created files in a directory
Message-Id: <7n7qh7$uuk$1@lublin.zrz.tu-berlin.de>

Larry Rosler <lr@hpl.hp.com> wrote in comp.lang.perl.misc:
>In article <slrn7pcspt.oqh.abigail@alexandra.delanet.com> on 21 Jul 1999 
>20:26:59 -0500, Abigail <abigail@delanet.com> says...
>> Larry Rosler (lr@hpl.hp.com) wrote on MMCL September MCMXCIII in
>> <URL:news:MPG.11ffb1f63386bf23989d10@nntp.hpl.hp.com>:
>> ** Assuming the 'changed' date is what you want, you must stat all the 
>> ** files (or use the '-C' operator, which does the same thing).  Then sort 
>> ** by it and slice the extreme five that you want from the sorted list.  Be 
>> ** sure to use a sorting method that stats each file once only, not in the 
>> ** sortsub. 
>> 
>> How inefficient! 
>...
>SNIP of extremum sort
>...
>> This is O (n), while sorting takes Omega (n log n).
>
>In fact, a few months ago I published a function 'extremes' in the Perl 
>Function Repository that works like that.  It turned out -- because of 
>the constant factors in the slow Perl code -- to be slower than simple 
>sort-and-slice for N < many thousands.  When I posted my response I 
>didn't think that kind of sort applied to this kind of situation, and I 
>still don't think it does.

I did a few benchmarks.  The break-even point seemed to be at about
500 list elements.  In reality, the difference may be swamped out
for many more elements by the stat() that must be done for each file.

Anno


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

Date: 22 Jul 1999 13:13:01 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Geekspeak Programming Contest
Message-Id: <37976d3d@cs.colorado.edu>

Here's a translation table to help techie programmer types talk with
consumerist user types, and vice versa .  Yes, I know that there's
a many-to-many mapping here; that's always true when translating one
language to another.  Oh, some of these are slightly less than serious,
and occasionally even slightly less than accurate.  I also intentionally
de-alphabetized them so you could have more fun reading through.

 * open source = source code
 * manpage = documentation
 * Enterprise = that spaceship from Star Trek 
 * binary edit = patch
 * physical disk = hard drive
 * box = computer
 * mount point = hard drive
 * file = binary file
 * open source = shareware
 * binaries = programs
 * alpha = beta
 * CGI scripts = CGIs 
 * partition = drive letter
 * off the net = offline
 * obvious = subtle
 * MS-ASCII = text
 * alpha = new technology
 * computer secretary = admin
 * logical disk = hard drive
 * Evil One = Bill Gates
 * program = script
 * criminal = hacker
 * bug fix = upgrade
 * commonplace = ubiquitous
 * programmer = software engineer
 * floppy disk = disk
 * luser = surfer
 * network = web
 * hide = protect
 * computer scientist = mathematician
 * net = web
 * daemon = server
 * legal extortion = per-seat licensing
 * diskette = disk
 * hacker = coder
 * physical disk = drive letter
 * secretary = HTML programmer
 * sysadmin = sysop
 * cracker = hacker
 * IRC client = IRC browser
 * computer = server
 * memory = RAM
 * logical disk = drive letter
 * programmer = scripter
 * mail messages = e-mails
 * flexible = difficult
 * beggarware = shareware
 * paid bug fixes = updates
 * disk drive = hard drive
 * Internet Exploder = Internet Explorer
 * eye trash = banner ads
 * shell command = system call
 * couldn't care less = could care less
 * drive = hard drive
 * greatest common factor = least common denominator
 * Unix = UNIX
 * Microsoft's mistakes = virii
 * copy = upload
 * competence = elitism
 * monolithic program = application
 * programming = scripting
 * computer scientist = engineer
 * fleeceware = software
 * lying = marketing
 * file system = hard drive
 * controller = hard drive
 * PC = home computer
 * coredump = blue screen 
 * offline = away from the computer
 * millennium = millenium
 * partition = hard drive
 * beginner = newbie
 * business = enterprise
 * competent = elite
 * bloatware = apps
 * fleeceware = commercial software
 * wizard = guru
 * function = command
 * configurable = confusing
 * Mordor = Redmond
 * mail = e-mail
 * challenging = impossible
 * kernel = kernal
 * disk controller = hard drive
 * mails = sends e-mails
 * executables = programs
 * binaries = shareware
 * crippleware = shareware
 * buggy = beta
 * mark-up language = programming language
 * system call = command
 * internal network = Intranet
 * beta = production
 * open source = freeware
 * system call = operating system function
 * copy = download
 * fix = hire a consultant for
 * luser = user
 * disk space = memory
 * code = software
 * MS-HTML = HTML
 * netiquette = useless manners
 * newsreader = news browser
 * unusual = unique
 * IRC channel = chat room
 * disk = hard drive
 * Evil Empire = Microsoft
 * GUI annoyance = wizard
 * operating system = kernel
 * kernel = operating system
 * newsgroup = chat room
 * elitist = professional
 * editor = text editor
 * monitor = computer
 * bloatware = application
 * patch = source edit
 * file = text file
 * file system = drive letter
 * expert-hostile = user-friendly
 * login = shell account
 * mount point = drive letter
 * connect to http://www.foo.com/ = logon to foo.com
 * access the web = surf the net

Your mission, should you choose to accept it, is to write a translator
program than converts from one lingo to the other, or vice versa.
Extra points will be given for having an especially amusing word list
(you don't have to use mine), for handling plurals and capitals well,
and in general, for hackish clevernesses.  The program should work for
translating between other domains as well, such as East Coast vs West
Coast jargon, programmer vs manager, etc.

--tom
-- 
	    Ivy, privy, famous; clamour
	    And enamour rhyme with hammer.


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

Date: Thu, 22 Jul 1999 15:28:09 -0400
From: matt <mlopresti@bigfoot.com>
Subject: Re: Help me ..; databases ...
Message-Id: <379770C9.9CD309F6@bigfoot.com>

Here is an example of a connection and select statement:


 #open connection with DB
$DSN ="your_domain_name";
if (!($db = new Win32::ODBC("DSN=your_domain_name;"))) {
 print STDOUT "Error connecting to $DSN\n";
 print STDOUT "Error: " . Win32::ODBC::Error() . "\n";
 exit;
}

$SqlStatement = "SELECT table_name.field_name
      FROM table_name;";

if ($db->Sql($SqlStatement)) {
 print "SQL failed- Cannot execute\n";
    print "Error: ". $db->Error(). "\n";
    $db->Close();
    exit;
}
$db->Close();

There are other ways of doing this, this is just how I like doing it :-)
-Matt

danny wrote:

> Thanks to all for the answers..
> 1)
>
> I'm trying to get a understanding for ODBC ... (i know oracle ..) but it seems
> that i'm making the same mistakes over and over again...
>
> Is there a BASIC statement for the ODBC
>
> like
>
> create a table
> assign data to it
> and read it ...
>
> i tried to search.. but all the examples seems buggy ... (i run apache
> locally...)
>
> this example
> 1. use Win32::ODBC;
> 2. $db=new WIN32::ODBC('simple');
> 3. $varname="CGI Programming with Perl";
> 4. $db->Sql("select aname,price from  mytable where
>                    book='$varname' ");
> 5. $db->FetchRow();
> 6. ($Author,$cost)=$db->Data("aname","price");
> 7. print  "The Book titled $varname is written by $Author
>    and costs  $cost";
>
> found at  http://members.tripod.com/~anzer...
> isn't working for me ... thats why i need a comprehensive example source code
>
> 2)
>
> Whats wrong with :
> $db->sql("select * from [table1]");
> it won't perform the sql statement...
>
> and
> $db->sql("select field1 from [table1]");
> is even a bigger dissaster..
>
> is there a good url where i can find comprehensive and CLEAR transparent
> information about ODBC ?
>
> Many thanks,
>
> danny
>
> Jeff Thies wrote:
>
> > > Windows NT Server
> > >                                                        Database and CGI
> > >
> > > ColdFusion 4 Enterprise
> > >
> > > Chili!ASP
> > >                                                                 PhP3
> > >                                                                  Perl 5,
> > > Visual Basic & C++ CGI
> > >                                                                  ODBC
> > > Support
> > >
> > > whats the best way to use a database in perl ?
> >
> > DBI::DBD and DBD::ODBC
> >
> > Check the DBI man page... You might just want to run CF instead, easy
> > but not as flexible.
> >
> > Jeff






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

Date: Thu, 22 Jul 1999 15:28:11 -0400
From: brian@pm.org (brian d foy)
Subject: Re: Help using GET to pull down and HTML document.
Message-Id: <brian-ya02408000R2207991528110001@news.panix.com>

In article <7n7ov2$fm6$2@nnrp03.primenet.com>, "Jason Gabriel" <jasong@intrasonic.com> posted:

> This works great on servers that are not using HTTP 1.1 redirection. The
> page is there but the server returns "Not Found" because my hosting service
> has multiple domains on 1 ip address using HTTP 1.1 redirection with IIS 4.
> So what happens is that www.intrasonic.com/main.htm is there but this code
> below will not find it because of the redirection.
> 
> Pleeasss help me! I would really appreciate any help.

dump IIS 4.  get a real web server that is HTTP/1.1 compliant.  that's 
the best answer i can give you.

btw, you only need to post once.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: Thu, 22 Jul 1999 15:31:42 -0400
From: brian@pm.org (brian d foy)
Subject: Re: index.cgi script help
Message-Id: <brian-ya02408000R2207991531420001@news.panix.com>

In article <37967D43.B87E5059@customautotrim.com>, Mike <mike@customautotrim.com> posted:

> I am on a server that uses an index.cgi file that redirects all requests
> for my main domain (http://customautotrim.com) to
> http://customautotrim.com/index.html with this command:
> 
> if($url eq "") {$url="http://www.customautotrim.com/index.html"}
> 
> I want it to be
> if($url eq "") {$url="http://www.customautotrim.com/"}
> 
> The problem is that the index.html always shows up in the address bar.
> My host says I can't change the script like that, and there is not a
> scipt  anywhere that I can use to achieve my goal.

the web server is might be doing that.

it would be a lot smarter, and less resource intensive, to do this
in the server configuration rather than with a CGI script.  this has
to be about the most clueless way to accomplish this task.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: Thu, 22 Jul 1999 15:37:45 -0400
From: brian@pm.org (brian d foy)
Subject: Re: LWP and PUT
Message-Id: <brian-ya02408000R2207991537450001@news.panix.com>

In article <3796F242.EBB4B22@patriot.net>, HC <carvdawg@patriot.net> posted:

> Does anyone have any code showing the correct usage of the HTTP PUT
> method?
> I'm having trouble getting it working correctly.  I am on NTServer 4.0,
> using AS 518.
> I have read the docs that come with the install, and looked in the Perl
> Cookbook (which
> is the ONLY site with an example),

the Perl Cookbook isn't the only site with an example by a long shot.
perhaps you should use something like Yahoo or Altavista or see my
earlier message on this subject.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: Thu, 22 Jul 1999 15:32:52 -0400
From: brian@pm.org (brian d foy)
Subject: Re: Need Help with Virtual Avenue
Message-Id: <brian-ya02408000R2207991532520001@news.panix.com>

In article <37967e96.222924684@news.giganews.com>, XXX@hotmail.com (Rich) posted:

> I made a very simple script and tried to run it on my web site on
> Virtual Avenue. It keeps giving me an "Internal Server Error." As far
> as I know I'm doing every thing right and there is NO CLUE as to what
> the problem is!!! Can someone who is using Virtual Avenue give me one
> of their simple perl scripts and the corresponding html code so I can
> get SOMETHING to work on Virtual Avenue?

why not ask Virtual Avenue?

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: 22 Jul 1999 13:17:14 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl Compiler??
Message-Id: <37976e3a@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, Mike <kangas@anlon.com> writes:
:I have seen an Alpha Perl Compiler Kit. The release is from Sept. 1996.
:Does anyone have any idea about any newer versions or what the status on
:a perl compiler is??

It's just part of the standard release now, and is talked about in the FAQ.
Please understand that it does virtually nothing to improve the speed, size,
security, portability, or maintainability of your program.  In fact, it 
can even hurt these.

--tom
-- 
    str->str_pok |= SP_FBM;                     /* deep magic */
    s = (unsigned char*)(str->str_ptr);         /* deeper magic */
        --Larry Wall in util.c from the perl source code


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

Date: Thu, 22 Jul 1999 14:08:28 -0500
From: Bruno Pagis <pagib@aur.alcatel.com>
Subject: Perl Power Tools (PPT): get rid of other shells ?
Message-Id: <37977A3C.72078698@aur.alcatel.com>

With all UNIX commands ported in Perl (see http://language.perl.com/ppt/),
the next step is to be able to call
a Perl shell when logging in onto a unix/x/y/... machine, and be right away in
the perl interpreter with all the PPT commands accessible.
No more csh/tcsh/ksh/blabla/...

I am dreaming, or has it been done already ?


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

Date: Thu, 22 Jul 1999 15:25:22 -0400
From: brian@pm.org (brian d foy)
Subject: Re: PGP and Mail
Message-Id: <brian-ya02408000R2207991525220001@news.panix.com>

In article <lPGl3.881$ui4.277838@news.shore.net>, Scratchie <upsetter@ziplink.net> posted:

> Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
> :>
> :>This seems to work fine for my purposes. Am I missing something obvious by
> :>not using Open3?
> 
> : Probably not.  perdoc IPC::Open3 tells you
> 
> :        IPC::Open3, open3 - open a process for reading, writing,
> :        and error handling
> 
> : Now explain why you prefer reading this on a newsgroup to reading
> : it locally.
> 
> Gee, thanks so much for your help. If you read my message, you read that I
> *already* read the documentation for IPC::Open3. My question was: "The
> documentation is unclear; what are the important differences between using
> this module vs. simply opening a pipe to the program in question?" The
> only answer I've gotten so far is that "Open3 does things that open
> doesn't" but no indication of what those things might be,

read Anno's response again.  that's what IPC::Open3 does.  the builtin
open() doesn't do that.  if you want to read and write to another
process, you can't use open().   would you rather Tom wrote you a
FMTYEWTK on the subject?

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: 22 Jul 1999 19:46:11 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Returning file handle from a subroutine
Message-Id: <7n7se3$v1k$1@lublin.zrz.tu-berlin.de>

Rajasankar  <rajasankark@my-deja.com> wrote in comp.lang.perl.misc:
>
>
>Hello,
>
>I have a piece of code which returns filehandle to the
>file passed to it.
>
>sub myopen{
>  open(HANDLE,$_[0]) or die "cannot open $_[0]";
>  return(*HANDLE);
>}
>
>My doubt is won't there be any conflict if this function is used
>more than once to open different files,since file handle has same
>name? Won't read on all the file handles returned from the subroutine
>read only from the last file opened?
>
>Could anybody suggest any alternative?

Look into the Symbol module (perldoc Symbol) which is exactly
for these cases.

Anno


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

Date: Thu, 22 Jul 1999 18:59:18 GMT
From: skao@my-deja.com
Subject: Re: RFC 1867, file upload
Message-Id: <7n7plv$2qm$1@nnrp1.deja.com>

I apologize for being hasty.  Thank you for the help.  Unfortunately, we
are still using Perl 5.001; according to the CGI.pm documentation, it
requires at least Perl 5.005.

The webmaster has informed me that he will not install additional
modules.  I've attempted to install it in my personal directory, but I'm
getting an error message "overload.pm not found in @INC .... (etc)",
when I try to use CGI.

Is there any other way of implementing a form-based file upload through
a perl script?  Is there a simpler way to keep binary files from being
corrupted by reading through STDIN?

Thank you for your help.

In article <37973fe7@newsread3.dircon.co.uk>,
  Jonathan Stowe <gellyfish@gellyfish.com> wrote:
> skao@my-deja.com wrote:
> > In article
<Pine.HPP.3.95a.990722011035.17832B-100000@hpplus03.cern.ch>,
> >   "Alan J. Flavell" <flavell@mail.cern.ch> wrote:
> >> On Wed, 21 Jul 1999 skao@inteliant.com wrote:
> >>
> >> > Does anyone know of a CGI program that enables form-based file
> > uploading
> >> > to a Solaris 2.6?
> >>
> >> Does anyone _not_ know CGI.pm?
> >>
> >> Of course, you also need a browser that supports it, but neither of
> >> these aspects is a Perl language question.
> >>
>
> > You seem to have truncated part of my original post:
> >
> > "I've attempted utilizing a simple Perl script, but the file
transfer
> > will only work on ASCII text.  Any help would be appreciated."
> >
> > I am just reading in w/ STDIN.
> >
> > If you could perhaps direct me to where I could go to find a
solution,
> > since I know not where to look at this point, I would appreciate it.
> > Forgive me for not knowing the answer, I have been learning Perl for
a
> > relatively short period of time.
> >
>
> Alan *did* give you a solution - the module CGI.pm which is part of
the
> distribution for all recent Perl. The module has a section in its
> documentation that specifically addresses this question.
>
> --
> "I came on the train but I think I managed to pass it off as an asthma
> attack" - Jenny Eclair
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 22 Jul 1999 19:30:32 GMT
From: John Siracusa <macintsh@cs.bu.edu>
Subject: Re: TPJ/Earthweb junk mail?
Message-Id: <7n7rgo$f5u$1@news1.bu.edu>

Greg Bacon <gbacon@itsc.uah.edu> wrote:
> You don't have to be pushed around by some fucking "HTML programmer",
> you know.

You're right!  I'll just select a more readable style sheet
from my browser's menu...and...hmmm...wait a second...

<insert "web standards now!" rant>

-----------------+----------------------------------------
  John Siracusa  | If you only have a hammer, you tend to
 macintsh@bu.edu | see every problem as a nail. -- Maslow


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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 V9 Issue 228
*************************************


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