[7935] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1560 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 31 22:07:43 1997

Date: Wed, 31 Dec 97 19:00:22 -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           Wed, 31 Dec 1997     Volume: 8 Number: 1560

Today's topics:
     Re: 'flock'ing <rootbeer@teleport.com>
     Re: 'flock'ing (Tad McClellan)
     Benchmarking <mhanson@arrowweb.com>
     Re: Building libwin32 with VC++5 , fatal errors (Gurusamy Sarathy)
     bulk mail <mhanson@arrowweb.com>
     Re: bulk mail (Robert Haig)
     Re: Can you make a literal "@" show up in a format? <janetbuehler@mindspring.com>
     Re: Can't e-mail & redirect simultaneously <janetbuehler@mindspring.com>
     Re: CGI y comandos SSI <rootbeer@teleport.com>
     Re: GDBM_File <rootbeer@teleport.com>
     Re: importing subroutines (Tad McClellan)
     Re: instructions for using curses library <rootbeer@teleport.com>
     Re: Newbie question <jcotton@erols.com>
     Re: Perl location <rootbeer@teleport.com>
     Re: Putting a Caret in My Unix Prompt Capitalizes the N <rootbeer@teleport.com>
     Re: reading in passwords <ajh@rtk.com>
     Re: reading in passwords <tex@collegenet.spam-is-bad.com>
     Re: Search and replace questions <rootbeer@teleport.com>
     Re: Simple(!) regular expression problem <ajh@rtk.com>
     Re: SSI and FrontPage98 under IIS3 <rootbeer@teleport.com>
     Re: system command <ajh@rtk.com>
     Re: undefined value <rootbeer@teleport.com>
     Re: word wrap routine <rootbeer@teleport.com>
     Re: word wrap routine <jcotton@erols.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 31 Dec 1997 17:12:58 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Ernie Johnson <tcm@tcmd.com>
Subject: Re: 'flock'ing
Message-Id: <Pine.GSO.3.96.971231171106.27854T-100000@user2.teleport.com>

On Wed, 31 Dec 1997, Ernie Johnson wrote:

> NFS?  Isn't that a file system of the drive?

I don't know what "a file system of the drive" means, but you should be
able to find good info on NFS in your manpages or on the web.

> Anyway, anyone have a good, and reliable solution for non-flock on unix
> sytems?  Right now, I'm back to a timed loop to see if a lock file clears
> and if so, proceed with its work, but if it doesn't clear after 15 seconds
> it wipes out the lock in case of a prior crash of sorts and continues.

That's a lousy way to do that; you may as well not have read what the FAQ
says about this. :-)

But if your system doesn't properly support flock, the real solution is to
fix your system. Good luck!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Wed, 31 Dec 1997 19:16:29 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: 'flock'ing
Message-Id: <dpqe86.q72.ln@localhost>

Mark S. Reibert (reibert@mystech.com) wrote:
: Ernie Johnson wrote:

: > Actually, I forgot to indicate that I have tried the process with the seek
: > in place.. still no luck.
: >
: > In response to a direct email I received on the problem, here is part of it:
: >
: > >>  *) your file is accessed through NFS (flock() don't work well with NFS)

: Hmmm, I wasn't aware of this - maybe it's the source of your problem.


Perl FAQ, part 5:

   "How can I lock a file?"

says:

   Some versions of flock() can't lock files over a network (e.g. on NFS
   file systems)


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


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

Date: Wed, 31 Dec 1997 19:28:06 -0800
From: Mike <mhanson@arrowweb.com>
Subject: Benchmarking
Message-Id: <34AB0D46.5620@arrowweb.com>

What code do you use to make it so that you can see how much cpu usage
and additional stuff that your perl program is taking up. Also is there
a way to see how many times that the program could be accessed without
seeing a noticable slow down in the server, or see how many times it
could be accessed per second without getting a could not fork new
process error?


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

Date: 1 Jan 1998 02:36:17 GMT
From: gsar@engin.umich.edu (Gurusamy Sarathy)
Subject: Re: Building libwin32 with VC++5 , fatal errors
Message-Id: <68evf1$7qh@srvr1.engin.umich.edu>

  [ mailed and posted ]

In article <883603641.1647837190@dejanews.com>,
 <danny@lennon.postino.com> wrote:
>I have built the core perl5.004_04 dist with MS VC++5
>fine, but am getting fatal error: don't know how to
>make 'blib\lib\.exists' when I run nmake in the libwin32-0.08
>directory. I did run ./perl Makefile.pl , and got no errors.
>I tried to make individual modules, like ODBC or NetAdmin
>and am getting the same error. Any help appreciated.

I cannot replicate the problem here.  It looks like Makemaker is confused
about the .exists files somehow.  I'd suggest deleting the libwin32-0.08
directory, and starting from scratch.  BTW, you should probably get the
latest version (0.09) while you're at it.

Hope it's not Windows95 you're suffering from.

 - Sarathy.
   gsar@umich.edu



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

Date: Wed, 31 Dec 1997 19:21:52 -0800
From: Mike <mhanson@arrowweb.com>
Subject: bulk mail
Message-Id: <34AB0BD0.1BB1@arrowweb.com>

If i am writing a program to send bulk email, is using sleep 1 enough
time to make it so that i don't overload the sendmail program?


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

Date: 1 Jan 1998 01:29:47 GMT
From: rhaig@austin.ibm.com (Robert Haig)
Subject: Re: bulk mail
Message-Id: <68erib$1qho$1@ausnews.austin.ibm.com>

In article <34AB0BD0.1BB1@arrowweb.com>, Mike  <mhanson@arrowweb.com> wrote:
>If i am writing a program to send bulk email, is using sleep 1 enough
>time to make it so that i don't overload the sendmail program?

no, I think you should use sleep 500, then shoot yourself in the foot.

repeat in a tight loop until you realize bulk mail is bad juju.
-- 
Rob


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

Date: Wed, 31 Dec 1997 18:02:12 -0500
From: "Janet Buehler" <janetbuehler@mindspring.com>
Subject: Re: Can you make a literal "@" show up in a format?
Message-Id: <68ese9$mjf@camel12.mindspring.com>

Thanks.  After sleeping on it, it was obvious that I should be putting the
addresses in with variables instead of hardcoding them.

The nature of the report guarantees that it will only be 20 to 30 lines,
max, so I'll never see a second occurrance of the _TOP format. But you get
extra brownie points for flagging that issue!


--Georg

brian d foy wrote in message <68d0mk$jdd@bgtnsc02.worldnet.att.net>...
>In article <68cj66$nmr@camel20.mindspring.com>, "Janet Buehler"
<janetbuehler@mindspring.com> wrote:
>
>> I've created a Perl script that compiles some FTP statistics, and then
>> writes it out in a formatted table to an email message to me. I would
like
>> to be able to specify the To:, From:, and Subject: headers in my
REPORT_TOP
>> format, so the header information is passed to /usr/lib/sendmail -t when
I
>> write the report:
>>
>> format REPORT_TOP =
>> To: me@mysite.com
>> From: me@myserver.com
>> Subject: FTP Statistics
>>
>> Date--------------File----------Att--Suc---UF----Bandwidth
>> .
>
>> However, the format doesn't like to see those "@"s in the email
addresses --
>> it perceives them to be misused picture fields.
>
>i'll defer on the original question to suggest not using a top of
>page format like so.  you only need to send the mail header once.  if
>your report has more lines than the defined length of the page, you'll
>get all that mail header stuff again.  blech!
>
>but back to your question.  there is this snippet from the perlform
>man page:
>
>     To get a real at or caret into the field, do this:
>
>         format Ident =
>         I have an @ here.
>                 "@"
>
>which looks like it can make for a really ugly format.  however, you
>might consider not hardcoding the addresses in the format:
>
>   format STDOUT_TOP =
>
>   From: @*
>   $from
>   To: @*
>   $to
>   Subject: @*
>   $subject
>   .
>
>good luck :)
>
>--
>brian d foy                                 <http://computerdog.com>
>#!/usr/bin/perl
>$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
>qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
>$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm




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

Date: Wed, 31 Dec 1997 20:28:19 -0500
From: "Janet Buehler" <janetbuehler@mindspring.com>
Subject: Re: Can't e-mail & redirect simultaneously
Message-Id: <68esea$mjf@camel12.mindspring.com>

Oops, I didn't mean "process" in the UNIX sense, I simply meant they should
be independent subroutines -- the execution of one should not impact the
execution of another.  (I guess it's obvious that I'm not a native citizen
of the UNIX world.)

You are quite correct -- one process should handle both tasks fine. I'll be
more careful with my phrasology in future.

--Georg

>
>> The sending of email and the output of the redirection should be two
totally
>> separate processes.
>
>one process is quite capable of handling several tasks.  there is
>absolutely no reason to double the load on your server to simply
>send mail.
>
>i would suggest sending the HTTP response last though so you can
>catch errors before the server complains about them.
>
>--
>brian d foy                                 <http://computerdog.com>
>#!/usr/bin/perl
>$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
>qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
>$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm




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

Date: Wed, 31 Dec 1997 17:38:10 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Clinton Bodine <Clinton.Bodine@mci.com>
Subject: Re: CGI y comandos SSI
Message-Id: <Pine.GSO.3.96.971231173543.27854W-100000@user2.teleport.com>

On Wed, 31 Dec 1997, Clinton Bodine wrote:

> I personally welcome non-English questions.  Unfortunately, I don't have
> a grasp of any other language except for a little German.  Could someone
> translate this question for us?=20
>=20
> NICOLAS wrote:
> >=20
> > Pregunta:
> > Para hacer que un CGI se ejecute automaticamente al cargar una p=E1gina=
 WEB
> > se consigue, mediante el uso de comandos SSI,  de la forma:
> >=20
> > <!--#EXEC CGI=3D"cgi-bin/fichero.cgi"-->

My grasp of Espanol is poor, but I strongly suspect this is not a Perl
question. If it's not covered in the docs and FAQs, it should probably be
asked in a newsgroup about servers or perhaps CGI. Maybe someone who
speaks Spanish can translate that suggestion for the benefit of the
original poster. Thanks!=20

--=20
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Wed, 31 Dec 1997 17:18:57 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Online Marketing Company <jims@online-marketing.com>
Subject: Re: GDBM_File
Message-Id: <Pine.GSO.3.96.971231171530.27854U-100000@user2.teleport.com>

On Wed, 31 Dec 1997, Online Marketing Company wrote:

> The camel book describes the module GDBM_File, but this module is not in
> the CPAN 07_Database_Interfaces section, with the others. 
> 
> I mostly concerned if official support for the GDBM libraries has been
> pulled.  Can someone please let me know? 

Even if someone had dropped "official support" for those libraries, that
needn't stop you from using them! :-)

But nothing has been pulled; the GDBM_File.pm module is bundled with Perl,
so you should automatically have it if your version of Perl is recent. If
your version of Perl isn't recent enough, it's just a little less
automatic. :-)

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Wed, 31 Dec 1997 19:14:03 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: importing subroutines
Message-Id: <rkqe86.q72.ln@localhost>

John Tannahill (jrt@llnl.gov) wrote:
: I have just spent quite a while trying to figure out how to call a perl
: subroutine that is
: in one file from a perl program in another file.  I have tried various
: "use" commands,
: but I keep getting the following error message:

: Undefined subroutine &main::seait ...

: There must be a simple way to do what I want?


The simplist way to figure out how to do stuff with subroutines is
to read the documentation that came with your perl distribution.

perlsub's top level heading is "Perl subroutines", so that would be
a good place to start.

After you have a look at what is says there, and you still cannot get
it to work, posting some code that you tried will help us to give
you a good answer.


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


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

Date: Wed, 31 Dec 1997 17:55:13 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Devin P. Anderson" <dev@sgi.net>
Subject: Re: instructions for using curses library
Message-Id: <Pine.GSO.3.96.971231175325.27854Z-100000@user2.teleport.com>

On Wed, 31 Dec 1997, Devin P. Anderson wrote:

> Where can I get some good instructions on how to use the curses module?

In what way are the module's own docs deficient for your needs?

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Wed, 31 Dec 1997 21:46:07 -0500
From: Joseph Cotton <jcotton@erols.com>
Subject: Re: Newbie question
Message-Id: <34AB036F.5DE9@erols.com>

alecto wrote:
> 
> Blaine Owens <bowens@eastman.com> wrote:
> >I have a perl script which reads a file and parses out particular fields to
> >produce a report. One of the fields is like "(45.0%)" but I would like for
> >it to be just "45.0" in the report. What is the best way to strip the
> >leading "(" and the trailing "%)"? Thanks.
> 
> try:
> 
> #! /usr/bin/perl -w
> $foo = "(45.0%)" ;
> $foo =~ s/[()%]//g;
> print "$foo\n";

I'm new to perl, too, and I retch at the sight of such code.  Can any
one of you nice perl nerds create a series of functions to format
strings and numbers, so I can format things like I am able to in some
more civilized languages, that is, with out the use of a tilde and
slashes =~s/u/c/k/s;  I am not judgemental, this is just my own humble
opinion.  I believe in "each to his own", and I could be much more
productive without tildes.  

05 SINCERELY-YOURS  PIC ZZ,ZZZ.99   VALUE "JOE".


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

Date: Wed, 31 Dec 1997 17:08:33 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: s9ulzf <s9ulzf@fnma.com>
Subject: Re: Perl location
Message-Id: <Pine.GSO.3.96.971231165655.27854Q-100000@user2.teleport.com>

On Wed, 31 Dec 1997, s9ulzf wrote:

> Is it possible to ask a perl program to search for perl in multiple
> locations? 

Sure, but you can't ask the perl binary to do anything until you've found
it! :-) 

First, the real solution is to put a symbolic link to the real perl binary
in a reliable place, such as /usr/local/bin/perl. (This is one of the
reasons that symbolic links were invented.) 

But if you can't do that, the next choice is to put perl somewhere along
the user's PATH, then use something like this. (Modified slightly from
what's in the perlrun manpage.)

    #!/bin/sh -- # required comment mentioning perl
	eval 'exec perl -S $0 ${1+"$@"}'
	    if $running_under_some_shell;

    print "Yes, I'm running Perl!\n";

You could concoct something to search in just one or two locations, but
that's what the PATH is for, isn't it? Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Wed, 31 Dec 1997 17:49:56 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Kevin M Simonson <simonsen_nospam@skopen.dseg.ti.com>
Subject: Re: Putting a Caret in My Unix Prompt Capitalizes the Next Character
Message-Id: <Pine.GSO.3.96.971231174619.27854Y-100000@user2.teleport.com>

On 31 Dec 1997, Kevin M Simonson wrote:

>           oas~h/simonson/Perl} cat Simple
>           #!/usr/local/bin/perl
>           print "a^g:"
>           oas~h/simonson/Perl} set prompt = `~simonson/Perl/Simple`" "
>           a^G:
> 
>      The thing that's been bothering me is the capital 'G' from the small
> 'g'.  Anybody know why this is happening?  Or how I can make it stop hap-
> pening?

Whatever the reason, it is being done by your shell rather than by Perl. 
So this isn't really a Perl problem. But my guess is that the shell
interprets '^g' as meaning that you want a control-G, which it prints as
'^G'. Check your shell's docs to find out how to make a literal caret in
the prompt. 

> Is there a way to set my prompt from within the "perl" script, instead
> of reverting to a Unix call that refer- ences a "perl" script, as I'm
> doing above? 

Perl doesn't have a built-in prompt, so there's no way to set one! :-) 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Wed, 31 Dec 1997 16:52:19 -0800
From: "Aaron Harsh" <ajh@rtk.com>
Subject: Re: reading in passwords
Message-Id: <68epb7$o1f$1@brokaw.wa.com>

Devin P. Anderson wrote in message <34AA63C5.3E80@sgi.net>...
>How can you read from STDIN and not display what is being typed on the
>screen? Like a password. Is this possible though a socket?


The perlfunc manpage has a quick and dirty solution in the description for
'crypt' (although it probably won't work under anything but UNIX).

Aaron Harsh
ajh@rtk.com




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

Date: Wed, 31 Dec 1997 18:13:05 -0800
From: Austin Schutz <tex@collegenet.spam-is-bad.com>
To: "Devin P. Anderson" <dev@sgi.net>
Subject: Re: reading in passwords
Message-Id: <34AAFBB1.62C0@collegenet.spam-is-bad.com>

Devin P. Anderson wrote:
> 
> How can you read from STDIN and not display what is being typed on the
> screen? Like a password. Is this possible though a socket?

Sure.. I'd recommend using IO::Stty, available on CPAN.


print "Enter password: ";
IO::Stty::stty(\*STDIN,'-echo');
$password = <>;
IO::Stty::stty(\*STDIN,'echo');
print "\n"; # The user's newline wasn't echoed


	I'm not quite sure what you mean by 'through a socket'.

	Hth,

	Tex


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

Date: Wed, 31 Dec 1997 18:10:09 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Pete Holsberg <pjh@mccc.edu>
Subject: Re: Search and replace questions
Message-Id: <Pine.GSO.3.96.971231180542.27854b-100000@user2.teleport.com>

On 31 Dec 1997, Pete Holsberg wrote:

> I have a file that has lines like this:
> 
> <FONT SIZE=+1>AC 106 Office Accounting I 3</FONT>
> <FONT SIZE=+1>EG 222 Literature II 3</FONT>
> 
> etc.
> 
> I would like to change them to:
> 
> <FONT SIZE=+1><a href="/cgi-bin/pick.cgi?AC106">AC 106</a> Office Accounting I 3</FONT>
> <FONT SIZE=+1><a href="/cgi-bin/pick.cgi?EG222">EG 222</a> Literature II 3</FONT>

That sounds like something that can be done with an s/// operator.

> But I haven't found an elegant way to do this...and I keep
> running into problems with that darned "?"!!

If your problem is typing the question mark, try holding down the shift
key. If the problem is something else, you'll have to be more specific.
:-) 

> I tried to isolate "(SIZE=+1)" and "([A-Z]{2}) (\d{3})" as
> three variables. 

It can be problematic (to say the least) to build a regular expression out
of text strings. That first one won't match 'SIZE=+1' and the second one
doesn't have a backslash, for example. 

> Would some kind soul please help? 

It sounds as if you're on the right track. If you need more help, see if
you can show us what you're trying that's not working. Thanks!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Wed, 31 Dec 1997 17:14:51 -0800
From: "Aaron Harsh" <ajh@rtk.com>
Subject: Re: Simple(!) regular expression problem
Message-Id: <68eqlk$qav$1@brokaw.wa.com>

Eric Bohlman wrote in message ...
>Laurel Shimer <autopen@autopen.com> wrote:
>: $reqinput ="360-WG-002 ";
>: $reqmatch =" 360-WG-002";
>                  ^  ^
>Dashes have a special meaning inside regular expressions.  That's what's
>causing your problem.

Do dashes have any special meaning outside a bracketed list?  I can't see
how this problem has anything to do with metacharacters.

It looks like the problem is that $reqmatch is assigned a string that has
spaces at the beginning, so it doesn't match $reqinput (which has no
whitespace at the beginning).  If you strip them off ( $reqmatch =~
s/^\s+// ), then your test:

>: if ($reqinput=~ /\b$reqmatch\b/) {print "matched\n";}
>: else {print "no match\n";}

will print "matched".  I think you might be a little confused about what
exactly the \b assertion does.  As a hint, it only looks for word boundaries
in the string being searched, not in the pattern being searched for.

Aaron Harsh
ajh@rtk.com




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

Date: Wed, 31 Dec 1997 17:44:23 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Moises G. Solis" <moises@texas.net>
Subject: Re: SSI and FrontPage98 under IIS3
Message-Id: <Pine.GSO.3.96.971231173932.27854X-100000@user2.teleport.com>

On 31 Dec 1997, Moises G. Solis wrote:

> I don't know where to turn for help.  Please point me in the right
> direction. 
> 
> I'm trying to execute a perl script from within an HTML page using SSI.  

Sounds as if you're trying to get your server properly configured under
Win95. Or perhaps you want to find out how to use SSI tags from your
server. 

If you can't find these answers after consulting your server's docs, you
should replace the server. Seriously, there are enough good free servers
out there that there's no need to stick with one with such shortcomings.
But if you want to keep the server, you could ask in a newsgroup about it. 

> Is there a FAQ somewhere?

Maybe you could use this one? 

    http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html

Good luck!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Wed, 31 Dec 1997 17:26:58 -0800
From: "Aaron Harsh" <ajh@rtk.com>
Subject: Re: system command
Message-Id: <68erca$q01$1@brokaw.wa.com>

Hi Bigfoot,

Bigfoot Schweiz wrote in message <34AAC9E7.3D5983DE@bigfoot.ch>...
>Does anybody have an idea how I can fetch the output of a system command?

This isn't the solution to your problem, but in case you were wondering you
can do it like this:

  $ps_output = `ps -a`;

or see the section on 'open' in the perlfunc manpage.

>Or does anybody know how I can look( certainly with Perl) how big a file
>is?


The -s function does this:

  $file_size = -s $file_name;

You can read all about it in the perlfunc manpage.

Aaron Harsh
ajh@rtk.com




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

Date: Wed, 31 Dec 1997 16:54:57 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: snailgem@aol.com
Subject: Re: undefined value
Message-Id: <Pine.GSO.3.96.971231165401.27854P-100000@user2.teleport.com>

On Wed, 31 Dec 1997 snailgem@aol.com wrote:

> The code works ($to_file is created), but it generates the following
> warning that I'd like to get rid of: 
> 
> Use of uninitialized value at /usr/local/lib/perl5/File/Copy.pm line 84
> (#1)

If this is a bug in the File::Copy module, you should fix it and submit a
patch using the perlbug utility which comes with perl. Thanks! 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Wed, 31 Dec 1997 17:34:46 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Gabor <gabor@vinyl.quickweb.com>
Subject: Re: word wrap routine
Message-Id: <Pine.GSO.3.96.971231172259.27854V-100000@user2.teleport.com>

On 31 Dec 1997, Gabor wrote:

> # why does everyone want to try to re-invent Text::Wrap?  
> 
> It was a 'quick and dirty solution'.  It wasn't really meant to work
> perfect but just give an idea to the poster. 

Compared to posting buggy code, it would have been better to give the
poster the idea of using a module, don't you agree?

> All people get here is 'Look in CPAN' and then have to
> search for bloody hours trying to find something.  

Does anybody really have to "search for bloody hours"? Perhaps you've
exaggerated. CPAN is well organized. There are indices. There is the
module list. There are search engines. There's the CPAN.pm module. I'm
sure that it's not really as hard as you say, but perhaps you have
suggestions on how it could be improved. 

> It's often easier and simpler to roll your own. 

It's always easier and simpler to use code that's already debugged, rather
than buggy code that doesn't work right. 

> If you give a pointer to CPAN at least say 'it's in the foobar dir under
> the author's name which is gumby'. 

That's not bad advice. Thanks!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Wed, 31 Dec 1997 22:01:02 -0500
From: Joseph Cotton <jcotton@erols.com>
Subject: Re: word wrap routine
Message-Id: <34AB06EE.5336@erols.com>

> 
> #
> # why does everyone want to try to re-invent Text::Wrap?  if you
> 
> It was a 'quick and dirty solution'.  It wasn't really meant to work
> perfect but just give an idea to the poster.  I am sorry if that
> offends you.  All people get here is 'Look in CPAN' and then have to
> search for bloody hours trying to find something.  It's often easier
> and simpler to roll your own.  If you give a pointer to CPAN at least
> say 'it's in the foobar dir under the author's name which is gumby'.
> 

Fact #1. I posted the question after about three hours of viewing the
avilable web pages and such.  Text:wrap was there, I just didn't see it.

Fact #2. When it was pointed out to me, I did not understand how to
implement it.  

Fact #3.  After entering "Text::wrap" and CGI into WebCrawler and Yahoo,
and looking at a minimum ten different "explanations" of this function,
only then did I begin to understand how to apply the function.  

Fact #4. The quick and dirty code which was friendly supplied by a nice
person (and thank you for your time) was ignored.  I simply do not
understand how to program using squigels (tildes).  I have done
programming in COBOL, C, BASIC and Visual Basic.  Perl is quite a ride.

Fact #5.  The function Text::wrap is now in production at my chat room. 
It works great, and thanks to Mike for recomending it, and thanks to
Dave for writing it.  

Opinion #1.  Could anyone now supply a set of functions to format
strings, so I do not need to use squiggles and slashes in my code
=~s/u/c/k/s.  I could be so much more productive that way.     

Opinion #2.  Perl is a language which took all the bad parts of C and
made them even worse.


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

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

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