[7364] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 989 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 7 11:17:19 1997

Date: Sun, 7 Sep 97 08:00:39 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 7 Sep 1997     Volume: 8 Number: 989

Today's topics:
     Re: "#!/path_to_perl -w" causes shell to be invoked (Chip Salzenberg)
     Re: [Q] Strange pack() results (Jason Gloudon)
     Re: C++Builder means Future. (Steve Mading)
     Can Perl program with C ? <d951686@umac.mo>
     Re: Can Perl program with C ? (Jason Gloudon)
     Re: cardinality of an array given a reference (Chip Salzenberg)
     Re: finding/storing/removing a substring (Dustin Puryear)
     Re: flock() problem (Chip Salzenberg)
     Re: flock() problem (Chip Salzenberg)
     Re: Getting rid of ] and [ in perl <mark@pbi.net>
     Re: grep-like search with multiple file output? (Maynard Hogg)
     Re: Handling complex table files <jtobey@user1.channel1.com>
     Re: Here Document with FILEHANDLE (Chip Salzenberg)
     Re: How to cut the double quotes of strings off for reg (Jason Gloudon)
     Re: Incredibly basic Newbie question <mark@pbi.net>
     Re: Integers, God, and etc. (Chip Salzenberg)
     Re: multidimensional arrays ? (Matti Kinnunen)
     Re: Multithreading in Perl? (Chip Salzenberg)
     Re: My vs local declarations (Chip Salzenberg)
     Re: Newbie File Locking (Chip Salzenberg)
     Re: newbie: how do I break a WHILE loop? <mark@pbi.net>
     Perl script to query a Qi server (Pui Ming WONG)
     Re: Range Parsing Issue (Jason Gloudon)
     Re: Shakespearian insult program <eric@semaphore.com>
     Re: Shakespearian insult program <eric@semaphore.com>
     Re: Time question.. (Clay Irving)
     Re: Time warp - Perl 4 question (Chip Salzenberg)
     Re: Wrote new module, need help with system dependencie (Bart Schuller)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 5 Sep 1997 17:00:14 GMT
From: chip@rio.atlantic.net (Chip Salzenberg)
Subject: Re: "#!/path_to_perl -w" causes shell to be invoked
Message-Id: <5updqu$bn5$1@news1.atlantic.net>

According to "Kipp E. Howard" <kipp.e.howard@boeing.com>:
>When testing the 5.003 version on some existing perl scripts from other
>platforms that used /site/sw/perl-5.003, we noticed that when the "-w"
>was used in the shebang line, the script was treated as a shell script
>and died on the first non-shell construct.

CXUX is probably just broken.
-- 
Chip Salzenberg          - a.k.a. -           <chip@pobox.com>
 (Roller coaster on camera:)  "Wow, this square quarter mile
    has unbelievably good light rail transit!"  // MST3K


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

Date: 7 Sep 1997 09:27:33 GMT
From: jgloudon@bbn.com (Jason Gloudon)
Subject: Re: [Q] Strange pack() results
Message-Id: <5uts25$ma1$1@daily.bbnplanet.com>

In article <slrn613d7o.17b.nicholas@neko.binary9.net>,
Nicholas J. Leon <nicholas@binary9.net> wrote:
>
>Hi again, neighbors.
>
>I was writing a perl module to handle [uw]tmp files (since the package
>advertised on CPAN cannot be located) and I've run across some
>confusion.
>
>It's creating the pack string that equals the structure of utmp. From
>my /usr/include/utmp.h:
>
>/* size of user name */
>#if 1
>#define UT_LINESIZE     12
>#define UT_NAMESIZE     8
>#define UT_HOSTSIZE     16
>
>use strict;
>
>my $PACK="SLA12A4LA8A16L";
 -REMOVED-
>I have a feeling this answer is going to be pretty simple, but I can't
>seem to get it.
>
The string fields in utmp are NULL-terminated strings. You need to use 
a instead of A.

Jason Gloudon


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

Date: 6 Sep 1997 23:52:40 -0500
From: madings@earth.execpc.com (Steve Mading)
Subject: Re: C++Builder means Future.
Message-Id: <5utbuo$j9a$1@earth.execpc.com>

John Palmieri (JohnP@MStarMedia.com) wrote:

:   It will be on IBM's AS/400 which is a UNIX derivitive.

The AS/400 is a Unix derivative????  Really?  I never used
one directly, but had to write software on a unix machine
to upload/download files to AS/400 and certainly didn't feel
unixy at all from my end.  It didn't allow arbitray nesting
of directories (just one flat list of 'directories' called
'libraries').  Its filesystem was not the generic string-of-bytes
type that you see in unix (and Windows).  It made you define
record lengths, and max record sizes, and so on, at the filesystem
level.  It had memberized versioning right in the filesystem
(instead of a seperate package like RCS).  Not unixy at all.  All
the text was in <shudder> EBCDIC and I had to convert it with
'dd' on our end.

The AS/400 looked to me to be nothing more than a leftover of
IBM's past era of computers designed to be nice for COBOL people
but awful for everyone else.

(Maybe you meant AIX not AS/400?)
-- 
Steve Mading:  madings@execpc.com   http://www.execpc.com/~madings



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

Date: Sat, 06 Sep 1997 15:45:31 +0800
From: "Eric , Chow Hoi Ka" <d951686@umac.mo>
Subject: Can Perl program with C ?
Message-Id: <34110A1A.E62C05DE@umac.mo>

Hello,
    Can Perl programming with C or calls C functions ?

Best regards,
Eric




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

Date: 7 Sep 1997 09:00:11 GMT
From: jgloudon@bbn.com (Jason Gloudon)
Subject: Re: Can Perl program with C ?
Message-Id: <5utqer$k18$1@daily.bbnplanet.com>

In article <34110A1A.E62C05DE@umac.mo>,
Eric , Chow Hoi Ka <d951686@umac.mo> wrote:
>Hello,
>    Can Perl programming with C or calls C functions ?
>
>Best regards,
>Eric

Yes. Take a look at the manpages for perlxstut and perlxs.

Jason Gloudon


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

Date: 5 Sep 1997 14:37:38 GMT
From: chip@rio.atlantic.net (Chip Salzenberg)
Subject: Re: cardinality of an array given a reference
Message-Id: <5up5fi$5lm$1@news1.atlantic.net>


According to tadmc@flash.net (Tad McClellan):
>Aaron Newman (newman@ttd.teradyne.com) wrote:
>: Hello, friends.  I am wondering about finding the cardinality of an
>: array given a reference to the array.  I am trying to do this in one
>: statement, dereferencing it and getting the cardinality at the same
>: time.  For example,
>
>: $arref=["one","two"];
>: @ar=@$arref;
>: print "cardinality is ",$#ar,"\n";
>
>   print "cardinality is ",$#{@$arref},"\n"; 
>

If that works, it's only by coincidence.  This is proper:

   print "cardinality is ",$#$arref,"\n"; 

-- 
Chip Salzenberg          - a.k.a. -           <chip@pobox.com>
 (Roller coaster on camera:)  "Wow, this square quarter mile
    has unbelievably good light rail transit!"  // MST3K


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

Date: Sun, 07 Sep 1997 14:29:02 GMT
From: dpuryear@usa.net (Dustin Puryear)
Subject: Re: finding/storing/removing a substring
Message-Id: <3412b9ff.4146449@news.intersurf.com>

On Fri, 5 Sep 1997 14:56:10 -0500, tadmc@flash.net (Tad McClellan)
wrote:

>: "string1,string2,string3,string5"
>: buf[3] = string4
>                 ^
>                 ^ 5?

  Don't ask.      ^^^^

>   @buf = split /,/, "string1,string2,string3,string5";

  Yeah, I missed the obvious. Thanks.


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

Date: 6 Sep 1997 04:54:10 GMT
From: chip@rio.atlantic.net (Chip Salzenberg)
Subject: Re: flock() problem
Message-Id: <5uqnli$cfh$1@news1.atlantic.net>

According to zod@home.net:
>Can someone please point out what is wrong:
>Platform: Sparc 5
>OS: Solaris 2.5.x
>open(FILE,"< /tmp/junk");
>flock(FILE,2);
>Does not lock! Do I need rpc.lockd or some other thing running on my
>machine?

Maybe your OS requires you to open for read/write before using flock.
-- 
Chip Salzenberg          - a.k.a. -           <chip@pobox.com>
 (Roller coaster on camera:)  "Wow, this square quarter mile
    has unbelievably good light rail transit!"  // MST3K


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

Date: 5 Sep 1997 17:00:51 GMT
From: chip@rio.atlantic.net (Chip Salzenberg)
Subject: Re: flock() problem
Message-Id: <5upds3$bna$1@news1.atlantic.net>

According to zod@home.net:
>Can someone please point out what is wrong:
>Platform: Sparc 5
>OS: Solaris 2.5.x
>open(FILE,"< /tmp/junk");
>flock(FILE,2);
>Does not lock! Do I need rpc.lockd or some other thing running on my
>machine?

Maybe your OS requires you to open for read/write before using flock.
-- 
Chip Salzenberg          - a.k.a. -           <chip@pobox.com>
 (Roller coaster on camera:)  "Wow, this square quarter mile
    has unbelievably good light rail transit!"  // MST3K


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

Date: Sat, 06 Sep 1997 21:48:05 -0700
From: Mark Tripod <mark@pbi.net>
Subject: Re: Getting rid of ] and [ in perl
Message-Id: <34123205.2F5@pbi.net>

Matt,

the right and left brackets are special characters in pattern matching,
therefore if you want to match those characters specifically you have to
escape them.

Try:
$value =~ s/(\[|\])//g;

Hope this helps,

Mark

Matt Weber wrote:
> 
> How do I get rid of these two charectors in perl: []
> 
> It should be
> 
> $value=~ s/[]//g;
> 
> right???
> 
> Why is this not working?
> 
> M. Weber
> --
> http://www.weberworld.com
> [Live Broadcasts 24 hrs a day!]


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

Date: 7 Sep 1997 20:40:58 +0900
From: maynard@gol.com (Maynard Hogg)
Subject: Re: grep-like search with multiple file output?
Message-Id: <vpBE0wY1bacc092yn@gol.com>

Tom Grydeland <tom@mitra.phys.uit.no> wrote:

>> Next question: How does one generalize this script to imitate AWK's
>> associative arrays?

>Why imitate them?  Perl has those too.  It just calls them hashes.

Not surprising considering perl's various debts to awk. "One of the
many cool things about Perl is that it is (at least) a semantic
superset of awk."--Randall L. Schwartz, "Learning Perl" ORA.

>>   pattern[++i] = "second pattern";outfile[i]=sprintf("out%05d",i)

>Hmm.  Those seem to be arrays, not hashes.  (numerical vs. string indices)

Don't quote me, but I believe awk always indexes on the string
representations. The following short program (MKS AWK) seems to bear
me out since all it prints is "456".

BEGIN {
  test[1] = "123"
  test["1"] = "456"
  for (i in test) print test[i]
  exit
}

Now whether the implementation uses hashes, a linked list, or whatever
is another issue entirely. MKS seems to use an LIFO arrangement.
Thompson Automation insists on sorting at the time--one reason why
there versions compiled to massive, slower beasts.

>I think I'd use a pattern -> filehandle mapping with a hash here:
>(tested code)

This code is beyond my limited perl knowledge, so let's get back to
AWK. <g>

--
Maynard Hogg
#306, 4-30-10 Yoga, Setagaya-ku, Tokyo, Japan 158
Fax: +81-3-3700-7399
Internet: maynard@gol.com
http://www2.gol.com/users/maynard/
http://www2.gol.com/users/maynard/j-learning.htm (Japanese)
Unsolicited commercial electronic mail sent to this address will be
copyedited at a cost of US$200/hour (half-hour minimum).


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

Date: 07 Sep 1997 02:07:57 +0000
From: John Tobey <jtobey@user1.channel1.com>
Subject: Re: Handling complex table files
Message-Id: <m3zpppho5e.fsf@user1.channel1.com>

dmacks@sas.upenn.edu (Daniel E. Macks) writes:

> 
> stefano bonacina (stefano.bonacina@st.com) said:
> : 
> : name  label             type                          default unit
> : words {Number of words} {range int 64 32768}           64      {}
> : bits  {Number of bits}  {range int 2 64}               2       {}
> : mux   {Mux size}        {enum int {4 8 16 32}}         4       {}
> : 
> : Separators are blank space, not tab (too easy :-).
> : Does anyone know any clever way to handle these lines assigning to
> : different variables the content of each fields? (I'm using perl 5.004)
> : Thanks in advance for your help
> 
> Is split() not working, or am I misunderstanding the question?
>   % perldoc -f split
>   As a special case, specifying a PATTERN of space (C<' '>) will split on
>   white space

As I understand, the fields may contain spaces, so split wouldn't
work.  If the fields are fixed-width (NO tabs!!), you should use e.g.

  ($name, $label, $type, $default, $unit) = unpack("A6A18A31A8A*", $line);

See the notes under "pack" for the "A" and "a" types.

-John


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

Date: 5 Sep 1997 15:27:29 GMT
From: chip@rio.atlantic.net (Chip Salzenberg)
Subject: Re: Here Document with FILEHANDLE
Message-Id: <5up8d1$7oi$1@news1.atlantic.net>

According to "Jerry Xia" <jxia@worldnet.att.net>:
>Is there any way that I can open a file with using here document? What I am
>trying to do is something like:
>
>open (FTP, "ftp -n $hostname <<EOF 
>		user xxx
>		ls -l
>		...
>		bye
>		EOF
>		"|);
>
>But it is not working.

No.  You should either use IPC::Open2, or else Net::FTP from libnet
(which obviates the need to spawn the ftp client program).
-- 
Chip Salzenberg          - a.k.a. -           <chip@pobox.com>
 (Roller coaster on camera:)  "Wow, this square quarter mile
    has unbelievably good light rail transit!"  // MST3K


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

Date: 7 Sep 1997 08:29:48 GMT
From: jgloudon@bbn.com (Jason Gloudon)
Subject: Re: How to cut the double quotes of strings off for regular expression?
Message-Id: <5utols$hk5$1@daily.bbnplanet.com>

In article <5uro5u$bgq$1@news.ncu.edu.tw>,  <dennis@csie.nctu.edu.tw> wrote:
>
> want to give a string as a regular expression matching pattern..
> but string has two double qouotes in it, how do I solve this problem?
>
> #This is my program for testing..
> #!/usr/bin/perl -w
> use LWP::Simple;
>
>  $doc=get 'http://dennis.ncu.edu.tw/rjtt.html';
>
>   $pattern= "/.*?<TABLE>.*?<TABLE>.*?<\/TR>(.*?)<\/TABLE>.*?/sig";
change this line to
   $pattern= ".*?<TABLE>.*?<TABLE>.*?<\/TR>(.*?)<\/TABLE>.*?";

>    #$pattern possible be gotten from @_
>     if($doc =~ $pattern)
and this to 
     if($doc =~ /$pattern/sig)
>      #Wrong!! It has two double qoutes

If you really want to do $doc =~ $pattern , $pattern must contain just
the regular expression NOT the delimiters //. 
However I don't like that syntax cause I can't find a way to specify
options (eg sig as above) you want.

Jason Gloudon


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

Date: Sat, 06 Sep 1997 21:45:02 -0700
From: Mark Tripod <mark@pbi.net>
Subject: Re: Incredibly basic Newbie question
Message-Id: <3412314E.2D1F@pbi.net>

Get the book "Learning Perl on Win32 Systems" aka "the Gecko book" by
Randal Swartz, Erik Olson and Tom Christansen. It is published by
O'Reilly and Associates. You should be able to find it in any computer
book store. Or you can purchase it via the WWW at
http://www.oreilly.com/publishing/perl/products.htm

Hope this helps,

Mark


Fred wrote:

> (Can someone point me to a tutorial or book which covers such elementary
> basics?)


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

Date: 5 Sep 1997 15:18:11 GMT
From: chip@rio.atlantic.net (Chip Salzenberg)
Subject: Re: Integers, God, and etc.
Message-Id: <5up7rj$7aj$1@news1.atlantic.net>

According to George Scott <george_scott@nrel.gov>:
>> > Tom C. once wrote "God created the integers.  
>> >All else is the work of man"
>
>A good quote, but not one of Tom's originals:
>  Tom was quoting the Prussian/German mathemetician 
>Leopold Kronecker (1823-1891).

Herr Kronecker lived before quantum mechanics.  Nowadays I think that
complex irrationals are the work of God, and man invented integers to
avoid going insane.
-- 
Chip Salzenberg          - a.k.a. -           <chip@pobox.com>
 (Roller coaster on camera:)  "Wow, this square quarter mile
    has unbelievably good light rail transit!"  // MST3K


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

Date: 07 Sep 1997 11:38:37 +0300
From: matti@universe.pc.helsinki.fi (Matti Kinnunen)
Subject: Re: multidimensional arrays ?
Message-Id: <lzu3fx4iya.fsf@universe.pc.helsinki.fi>

In article <340DF3BA.2C78@channels.nl> Bas van Reek <basvreek@channels.nl> writes:

   Is there a way to create multidimensional
   arrays in perl. (something like a(10,10) in 
   a lot of other languages)
   could noy find any docs about it ?

Try 
	man perllol


$array[0][0] = "this"
$array[0][1] = "is"
$array[1][0] = "an"
$array[1][1] = "example"


- matti - 
-- 
* matti.kinnunen@helsinki.fi *
* http://universe.pc.helsinki.fi/~matti/contact.html *
* +358-(0)40-593 50 91 but try first +358-(0)9-191 23978 *


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

Date: 5 Sep 1997 14:38:34 GMT
From: chip@rio.atlantic.net (Chip Salzenberg)
Subject: Re: Multithreading in Perl?
Message-Id: <5up5ha$5lt$1@news1.atlantic.net>

According to zen@execpc.com (Oddfellow):
>FYI: I'm trying to write an xsub to a library with callbacks, and that
>library will call perl asynchronously (via the xsub, of course), and
>possibly in several threads of execution.

Perl is not yet safe for multithreading, AFAIK.  Wait for 5.005, or
single-stream execution of Perl.
-- 
Chip Salzenberg          - a.k.a. -           <chip@pobox.com>
 (Roller coaster on camera:)  "Wow, this square quarter mile
    has unbelievably good light rail transit!"  // MST3K


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

Date: 5 Sep 1997 16:45:48 GMT
From: chip@rio.atlantic.net (Chip Salzenberg)
Subject: Re: My vs local declarations
Message-Id: <5upcvs$b5s$1@news1.atlantic.net>

According to WX Guest account <wxguest1@wv.MENTORG.COM>:
>1.  "Local:  This operator declares one or more global variables to have
>locally scoped values within the innermost enclosing block, subroutine,
>eval, or file."
>
>This implies to me that it uses or generates a global variable, but
>gives it a locally declared value.

Yes.

>2.  The same example with "my" would be:
>
>  my $file_name = $_[0];   # $file_name == /scratch1/temp/test2.txt
>  open (file_name) or die "Ooops:  $!\n";
>    print file_name "Did it work??\n";

No, the one-argument form of open() doesn't work with lexicals.
Instead, say "open (file_name, $file_name)".

>	1.  $file_name = blah    #A global declaration
>	2.  local $file_name = blah #A global, locally scoped value
>	3.  my $file_name = blah  #A local var, meaningless outside innermost
>
>What happens if $file_name isn't declared globally already, but I
>declare it with a "local" declaration instead of "my"?  Does it create a
>global variable, but hide the locally assigned value?

Yes.

>And are these declarations static or dynamic?

my() is processed at compile time, local() at runtime.
-- 
Chip Salzenberg          - a.k.a. -           <chip@pobox.com>
 (Roller coaster on camera:)  "Wow, this square quarter mile
    has unbelievably good light rail transit!"  // MST3K


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

Date: 5 Sep 1997 16:46:58 GMT
From: chip@rio.atlantic.net (Chip Salzenberg)
Subject: Re: Newbie File Locking
Message-Id: <5upd22$b69$1@news1.atlantic.net>

According to Tom Phoenix <rootbeer@teleport.com>:
>On Thu, 4 Sep 1997, Lutz Albers wrote:
>> Grrr. I thought that perl5.004 DOES indeed flush the file buffers before
>> releasing the lock (at least that whats perldelta claims). 

It does.

>It tries, but there's no reason to rely upon it. Releasing the lock
>explicitly before closing the file is a waste of a good line of code. :-)

Agreed.
-- 
Chip Salzenberg          - a.k.a. -           <chip@pobox.com>
 (Roller coaster on camera:)  "Wow, this square quarter mile
    has unbelievably good light rail transit!"  // MST3K


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

Date: Sat, 06 Sep 1997 21:38:54 -0700
From: Mark Tripod <mark@pbi.net>
Subject: Re: newbie: how do I break a WHILE loop?
Message-Id: <34122FDE.456C@pbi.net>

last;

Kenneth Vogt wrote:
> 
> Here's my code:
> 
> open (CATEGORIES, "$category_file") || &file_open_error('File',
> "$category_file", 'product_header', __FILE__, __LINE__);
> while (<CATEGORIES>)
> {
>         @database_row = split (/\|/, $_);
>         if ($database_row[0] eq $FORM{'category'})
>         {
>                 $category_description = $database_row[1];
> 
>                 # I got what I wanted.
>                 #  How do I break out of the WHILE loop?
>         }
> }
> close (CATEGORIES);
> 
> Please not the comment lines with my question.  Thanks!
> --
> Kenneth Vogt
> KenVogt@rkymtnhi.com
> 
> http://ModernShopping.com
> Buy Tupperware(r) products right on the WWW!


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

Date: 7 Sep 1997 05:38:22 GMT
From: s11976@net2.hkbu.edu.hk (Pui Ming WONG)
Subject: Perl script to query a Qi server
Message-Id: <5uteke$9qa$2@power42t.hkbu.edu.hk>

I'm looking for some sample perl scripts that do the job of 
querying staff info stored in a qi server (CCSO nameserver) using
the ph client program.
Could someone direct me to any so i don't have to write them
from scratch as i'm still not too good in the perl lang.
--
        __
   / \_/  )             __   Pui Ming WONG (E-mail: pm@hkbu.edu.hk) 
  /      ( -------------  }  System Support Programmer
 (  =l=ll===============__}  Computing & Telecomm. Services Centre
  \   _  (                   Hong Kong Baptist University 
   \_/ \__)                  224 Warerloo Road, Hong Kong 


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

Date: 7 Sep 1997 07:38:53 GMT
From: jgloudon@bbn.com (Jason Gloudon)
Subject: Re: Range Parsing Issue
Message-Id: <5utlmd$dg3$1@daily.bbnplanet.com>

In article <3410E35E.79E5C1A1@mail.earthlink.net>,
Benjamin Holzman  <bholzman@mail.earthlink.net> wrote:
>
>[posted & mailed]
>Coburn Watson wrote:
>while (<INFILE>) {
>  if (/^@{3,4}(\d+)/) {
>    $in_article = ($1 == $article_id);
>  }
>  print if $in_article;
>}
>
>Hope this helps,
>
>Benjamin Holzman

A really simple interpretation of what I think was asked for :

OUTER:
while (<INFILE>) {
  print /^\@{3,4}(\d+)/o ? "Id: $1\n" : $_;
}

Jason Gloudon


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

Date: 7 Sep 1997 04:37:59 GMT
From: Eric Anderson <eric@semaphore.com>
To: Jay Rogers <jay@rgrs.com>
Subject: Re: Shakespearian insult program
Message-Id: <5utb37$klv$1@207.17.114.19>

Jay Rogers wrote:
 ...
> Now who's going to be the first to come up with a Bevis and Butthead
> insult program?

There wouldn't be much to it, their active vocabulary is about the size
of their IQs:
--cut--
#!/usr/bin/perl -w

@column_1 = qw(
	stupid
	uh...
	);

@column_2 = qw(
	jerk
	butt-head
	uh...
	butt-licker
	);

$word_1 = $column_1[int(rand(@column_1))];
$word_2 = $column_2[int(rand(@column_1))];

print "\nYou $word_1 $word_2!\n\n";
--cut--

Feel free to fill these out as you come up with more. I stopped here so
I wouldn't cause offence...


-eric


posted and emailed.


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

Date: 7 Sep 1997 04:29:15 GMT
From: Eric Anderson <eric@semaphore.com>
To: Dave Furstenau <df@ravine.binary.net>
Subject: Re: Shakespearian insult program
Message-Id: <5utais$klv$0@207.17.114.19>

shakesperl! that's great! haha.

Dave Furstenau wrote:
> 
> Eric Anderson,
>      that beslubbering doghearted codpiece, <eric@semaphore.com> wrote:
> 
> > I've cut-and-pasted your suggestions into my version here. Now I can
> > rest easy knowing that every possible combination has a chance of
> > popping up. The 49.9999 rand thing is interesting, I didn't know that.
> > thanks!
> 
>      So, here I am ... sitting down to do a full day of database entry
> for a project several weeks behind.  Then some impertinent full-gorged
> lewdster post this whoreson piece of code and I end up burning the
> entire fen-sucked day reading through my old college copy of SHAKESPERE'S
> BAWDY (a scholarly tract on the Bard's use of ribald words, humor & double
> entendre) so that I can add them to the program.  Then I jump to the
> actual texts (King Lear's scene with Kent & Oswald is great fodder, btw)
> and there goes the afternoon.  (I didn't pay that close attention to them
> back when I was getting graded!)
>     Sirrah!  Methinks thou art the cullionly glass-gazing heir to a
> whoreson zed -- and a fishmonger to boot.  But your shakesperl program
> (give it a name, for god's sake) is absolutely hysterical.  I'm gonna
> customize the bejabbers out of it and add some arrays to concat a few
> simple sentences.
>     Maybe I'll get back to my database in a month ... or two ...
> 
>     Great stuff.
> 
>     Dave Furstenau
>          df@binary.net

-- 
---------------------------------------------------------------
Eric Anderson			Email: eric@semaphore.com
Software Developer		URL  : http://www.semaphore.com
Semaphore Corporation		Voice: 206.443.0651
2001 6th Ave., Suite 400	Fax  : 206.443.0718
Seattle, WA  98121		
---------------------------------------------------------------
"genius is one percent inspiration and ninety-nine percent perspiration"
-Thomas Edison


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

Date: 7 Sep 1997 10:43:05 -0400
From: clay@panix.com (Clay Irving)
Subject: Re: Time question..
Message-Id: <5uuehp$egu@panix.com>


In <atspublic-ya02408000R0309971413150001@news.negia.net> atspublic@bigfoot.com (Andrew Starr) writes:
>In article <340BF12E.290C@hotmail.com>, guitarplayer@hotmail.com wrote:

>> Is this the best or most effecient way of getting the local time (as for
>> just hour, minute, am/pm)???

>#date gets the date for the HTML confirmation
>($Second, $Minute, $Hour, $DayofMonth, $Month, $Year, $WeekDay, $DayofYear, 
>       $IsDST) = localtime(time);
>@DayNames = ('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
>@MonthNames = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 
>       'Oct', 'Nov', 'Dec');
>$fullyear = 1900 + $Year;
>if ($Hour > 11) {
>   $meridian = "PM";
>   } else {
>   $meridian = "AM";
>}
>if ($Hour == 0) {$Hour=12;}
>if ($Hour > 12) {$Hour=$Hour-12;}
>$clock= sprintf('%02d:%02d:%02d', $Hour, $Minute, $Second);
>#enddate

>print "Date: $DayNames[$WeekDay], $DayofMonth $MonthNames[$Month] $fullyear, 
>      $clock $meridian\n";

>This will get you:
>Date: Wed, 3 Sep 1997, 02:13 PM
>(You can choose not to use all the variables, of course.)

Perl Modules are your friend!

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

   use Date::Format;

   $template = "%a %d %h %Y, %I:%M %p";
   print "Date: time2str($template, time)\n";

prints:

  Date: Sun 07 Sep 1997, 10:46 AM

-- 
Clay Irving <clay@panix.com>                   http://www.panix.com/~clay/


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

Date: 5 Sep 1997 16:43:07 GMT
From: chip@rio.atlantic.net (Chip Salzenberg)
Subject: Re: Time warp - Perl 4 question
Message-Id: <5upcqr$b49$1@news1.atlantic.net>

According to menyhert@acm.org:
> I wrote a script using Perl 5.003.  It works great.  However, it is
> very complex and long (4500 lines).  The problem is that I have to
> move it back to Perl 4 to guarantee the widest range of acceptance.

I'm sorry.

>I've gotten the script cleaned up and stupified for Perl 4 (no "my" or
>"sub" arguments, etc).  The problem is that whenever my script exceeds
>2000 lines, every line after line 2000 reports a bogus syntax error.

There probably is a genuine syntax error that's just not obvious.
-- 
Chip Salzenberg          - a.k.a. -           <chip@pobox.com>
 (Roller coaster on camera:)  "Wow, this square quarter mile
    has unbelievably good light rail transit!"  // MST3K


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

Date: 7 Sep 1997 13:25:44 GMT
From: schuller+news@lunatech.com (Bart Schuller)
Subject: Re: Wrote new module, need help with system dependencies.
Message-Id: <873638736.549395@perla.rotterdam.luna.net>


In article <3410bd22.1867120@news.tornado.be>,
Bart Lateur <bart.mediamind@tornado.be> wrote:
>	if($_ eq 'MM') {
>		$short = "n"; $long = "N";
>	elsif($_ eq 'II') {
>		$short = "v"; $long = "V";
>	} else {
>		die "Not a TIFF file";
>	}
>
>This can be used like this:
>
>	($nom,$denom) = unpack("$long$long", $rational); # 8 bytes
>
>No byte swapping necessary.

But watch out if you want *unsigned* longs or shorts, because those don't
have their own pack() formats. You'll need to manually swap the result of
a "native" unpack() where appropriate.

-- 
Bart Schuller                  schuller+sig@lunatech.com At Lunalabs, where the
Lunatech Research              http://www.lunatech.com/  future is made today..
Partner of The Perl Institute  http://www.perl.org/    Linux http://www.li.org/


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

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

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