[10271] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3864 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 1 08:07:23 1998

Date: Thu, 1 Oct 98 05:00:40 -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           Thu, 1 Oct 1998     Volume: 8 Number: 3864

Today's topics:
        Accessing java classes from perl. <psdspss@execpc.com>
    Re: can't find loadable module? help.. (Honza Pazdziora)
    Re: Can't generate HTML! Why??? <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: CGI and file uploading <perlguy@inlink.com>
        Checking FS (File system) <pgh@ga.nl>
    Re: Checking FS (File system) (Honza Pazdziora)
    Re: Coding Standards? dave@mag-sol.com
        determine an IP <christian.koch@fuzzy-online.de>
        Does die close files (when caught) ? <preziosi@cnam.fr>
    Re: Does die close files (when caught) ? <perlguy@inlink.com>
    Re: File manipulation <ben@isolve.net>
    Re: File manipulation (Mark-Jason Dominus)
    Re: Hash Arrays rgee@telecom.com
    Re: Hash Arrays rgee@telecom.com
        haw copy file? <kyniu1@friko3.onet.pl>
    Re: Help with regular expression!!! (Ronald J Kimball)
        make script for NT? <kyniu1@friko3.onet.pl>
    Re: multiple name-value pair <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: Need IP Address Sort Subroutine <erhmiru@erh.ericsson.se>
    Re: Need IP Address Sort Subroutine (Lack Mr G M)
    Re: Need IP Address Sort Subroutine (Lack Mr G M)
        passing javascript vars to CGI <phinneas@eskimo.com>
        Problems Using a Compare Subroutine with Sort <willliams@clark.net>
        return code <nospam@nospam.com>
    Re: Rotating an array. (Bart Lateur)
        two subroutines depending on whether d/l complete or no (Daniel Pray)
        What is HFB? <eashton@bbnplanet.com>
    Re: What is HFB? (Jeffrey R. Drumm)
    Re: Word wrap for Perl <stuart@euronova.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Wed, 30 Sep 1998 22:47:59 -0500
From: Deva Seetharam <psdspss@execpc.com>
Subject: Accessing java classes from perl.
Message-Id: <3612FB6F.53416FF4@execpc.com>

I want to access java classes from a perl program.
Is it possible to do that ?
If yes , please advise me how to do this ?

Larry Wall mentioned in his interview to Dr.Dobbs Journal(02/1998) about
a hybrid
lang called JPL.
There is not much information in that issue.

Infact, I searched the web. I could not find any info.

Any help would be greatly appreciated.

Best Regards,
Deva



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

Date: Thu, 1 Oct 1998 07:29:01 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: can't find loadable module? help..
Message-Id: <slrn716bpt.4eu.adelton@aisa.fi.muni.cz>

On 30 Sep 1998 23:26:38 GMT, Wei Weng <wweng@attila.stevens-tech.edu> wrote:
> how would I know about it?

Ask them.

> And can i install it in my account without root priviledge?

Man page ExtUtils::MakeMaker has neat guidelines for this.

Hope this helps,

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: 01 Oct 1998 10:11:37 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Can't generate HTML! Why???
Message-Id: <83d88cvgzq.fsf@vcpc.univie.ac.at>

Re: Can't generate HTML! Why???, Kenneth
<kchunt@mail.hac.com> said:

Kenneth> I think I've hit a wall.  I'm trying to generate an
Kenneth> HTML document with my Perl script. I'm reading in a
Kenneth> list from a file and putting that into an option
Kenneth> list.

Kenneth> part of the script is below...

And the bit you didn't show us is almost certainly where the
error is.  Running as a CGI is utterly different to the
command-line (pace CGI.pm's wonderful efforts to make it
look the same :-)

I expect you're not testing the open() for failure.  Do that
first and you might find out what's going wrong.

hth
tony


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

Date: Thu, 1 Oct 1998 11:03:56 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: CGI and file uploading
Message-Id: <3613619C.308D795A@inlink.com>

there is an article, with code, on how to upload with CGI.pm at:
http://webreview.com/wr/pub/98/08/14/perl/index.html

brent
-- 
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$            Brent Michalski             $
$         -- Perl Evangelist --          $
$    E-Mail: perlguy@technologist.com    $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$


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

Date: Thu, 01 Oct 1998 10:18:00 +0200
From: Patrick <pgh@ga.nl>
Subject: Checking FS (File system)
Message-Id: <36133AB8.73FE@ga.nl>

Hi,

Does anyone have a script that will check the FS, and when it's > 80%
full, write a message or display something on the console or any
terminal.

I've heard this can be done in a awk script, perl script or tcl/tk
script. Can anyone mail this to me.

Thank, Patrick.
e-mail: pgh@ga.nl


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

Date: Thu, 1 Oct 1998 10:51:32 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Checking FS (File system)
Message-Id: <F05A5w.GLD@news.muni.cz>

On Thu, 01 Oct 1998 10:18:00 +0200, Patrick <pgh@ga.nl> wrote:
> Hi,
> 
> Does anyone have a script that will check the FS, and when it's > 80%
> full, write a message or display something on the console or any
> terminal.

#!/usr/bin/perl

my $fs = "/home";
my $treshold = 80;

my $use = (split /\s+/, `df -k $fs`)[-2];
$use =~ s/\%//;

print "Filesystem $fs is $use% full\n" if $use > $treshold;
__END__

or, TIMTOWTDI:

#!/usr/bin/perl
use File::Df;

my $fs = "/home";
my $treshold = 80;

my $use = (df ($fs))[-2];
print "Filesystem $fs is $use% full\n" if $use > $treshold;
__END__


Hope this helps,

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Thu, 01 Oct 1998 08:45:14 GMT
From: dave@mag-sol.com
Subject: Re: Coding Standards?
Message-Id: <6uvfeq$r83$1@nnrp1.dejanews.com>

In article <slrn714snb.vtq.stesch@parsec.rhein-neckar.de>,
  stesch@parsec.rhein-neckar.de (Stefan Scholl) wrote:
> On 29 Sep 1998 12:48:40 GMT, Ken Rich <kenr@troi.cc.rochester.edu> wrote:
> > In comp.lang.perl.misc, lemull@unx.sas.com writes:
> > :Can anyone point me to a set of Coding Standards developed
> > :specifically for Perl?
> >
> > Not perl specific, but Steve McConnell's (?) book __Code Complete__
> > from Microsoft Press has really great recommendations on coding
>        ^^^^^^^^^
> > standards, that bear a striking resemblance to man perlstyle, but
> > goes further in the good directions.
>
> Yeah, right. :-)

Surprisingly, it *is* a good book. If you think that it's ironic that it
comes from Microsoft, remember that another book in the same series is called
'Writing Solid Code' - now that *is* a laugh!

Dave...

--
dave@mag-sol.com
London Perl M[ou]ngers: <http://www.mag-sol.com/London.pm/>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 1 Oct 1998 13:46:01 +0200
From: "Christian Koch" <christian.koch@fuzzy-online.de>
Subject: determine an IP
Message-Id: <6uvpuh$nj$1@black.news.nacamar.net>

Hello,

I have programmed a counter. Now I would count hits on my webpage dependent
on the IP. How can I determine the IP of a webpage-user??

Thank you
Christian




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

Date: Thu, 01 Oct 1998 12:14:45 +0200
From: Paul Preziosi <preziosi@cnam.fr>
Subject: Does die close files (when caught) ?
Message-Id: <36137235.66CDB1C9@cnam.fr>

May I write ...

------------------------------------------------------------
sub play_with_file {
  open F, '<fname' or die "can't open";
  seek F, $doubtful_offset, O or die "bad offset";
  # ...
 =A0close F;
}

eval { play_with_file(); }
handle( $@ ) if $@;
------------------------------------------------------------

 ... and trust that F will be closed anyway,
 or should I write ...

------------------------------------------------------------
sub play_with_file {
   open F, '<fname' or die "can't open";
   eval {
     seek F, $doubtful_offset, O or die "bad offset";
     # ...
   }
 =A0 close F;
   die if $@;
}

eval { play_with_file(); }
handle( $@ ) if $@;
------------------------------------------------------------
 =

 ... ?

 Thanks if someone can help. =


-- =

Paul Preziosi <preziosi@cnam.fr>

ISTNA/CNAM, 2 rue Conte, F-75003 Paris, France  =

Phone: (33) 140272474, Fax: (33) 140270153
--


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

Date: Thu, 1 Oct 1998 10:58:23 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Does die close files (when caught) ?
Message-Id: <3613604F.376C8D26@inlink.com>

when the program "dies", all file handles will be closed before Perl
exits.  so, you don't need the extra code in your program...

brent
-- 
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$            Brent Michalski             $
$         -- Perl Evangelist --          $
$    E-Mail: perlguy@technologist.com    $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$


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

Date: Thu, 01 Oct 1998 04:12:35 +0000
From: Ben Duncan <ben@isolve.net>
Subject: Re: File manipulation
Message-Id: <36130133.C0B3210D@isolve.net>

Hi!

> >> >New submission, posted from Fred (fred@domainname.com)
> 
>         if (m/^                      # Begins with:
>                 New submission       # this
>                 .*                   # yak yak yak
>                 \(                   # Then you see a parenthesis
>                         (.*)         # so remember the following text
>                 \)                   # Until you see another parenthesis
>               /x) {
>           $email = $1;
>         }

          
Using the above doesn't work. Here is my perl script:

#!/usr/bin/perl

$mbox = $ARGV[0];
$outputfile = $ARGV[1];

if(!$mbox || !$outputfile)
 {
 print "Usage: form-mine [mailbox] [output file]\n";
 exit(0);
 }
  
 open(MBOX,"$mbox");
 open(OUT,">$outputfile");

 while(<MBOX>)
 {
 if (m/^submitted/)
  {
   ($email) = /\([^(](.*)[^)]\)/;
   print OUT "$email\n";
  }

 }

And this doesn't work either. :(


bash-2.01# perl mailminer mbox out
bash-2.01# tail -n 5 out
eo@aper.ne
riathny@usa.ne
ecrtID@aol.co
arry@declera.co
dmin@cnesites.co

How come the first & last characters are stripped? What the
heck am I doing wrong?!

Ciao,


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

Date: 1 Oct 1998 04:53:33 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: File manipulation
Message-Id: <6uvfud$qjf$1@monet.op.net>

In article <36130133.C0B3210D@isolve.net>, Ben Duncan  <ben@isolve.net> wrote:
>Using the above doesn't work. 

How do you know?  Did you try?

> Here is my perl script:

No, I see you tried something else.

You've just discovered the perils of copying code that you don't
understand.   Your job now is to understand it and *then* copy it.


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

Date: 1 Oct 1998 11:53:48 GMT
From: rgee@telecom.com
Subject: Re: Hash Arrays
Message-Id: <6uvqgc$ong$1@orthanc.reference.com>

Thanks to the guys that responded to my post. You got it on the head.

After checking the HTML of the Web form which submits the Department Value,
I found that there was a space after each Department (Not viewable in the
popup 



  -------------------------------------------------------------------- 
  Posted using Reference.COM                  http://WWW.Reference.COM 
  FREE Usenet and Mailing list archive, directory and clipping service 
  -------------------------------------------------------------------- 


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

Date: 1 Oct 1998 12:05:05 GMT
From: rgee@telecom.com
Subject: Re: Hash Arrays
Message-Id: <6uvr5h$opo$1@orthanc.reference.com>

Thanks to the guys that responded to my post. You got it on the head.

After checking the HTML of the Web form which submits the Department Value,
I found that there was a space after each Department (Not viewable in the
popup menu)

The HTML looked like this;

<SELECT name="department" size="1">&nbsp;<OPTION selected>Select
from list</OPTION>&nbsp;<OPTION>Antennas</OPTION>&nbsp;<OPTION>Buying</OPTION>&nbsp;<OPTION>D.....

I removed the offending &nbsp; after every option and away we went!



Cool,

Thanks again


  -------------------------------------------------------------------- 
  Posted using Reference.COM                  http://WWW.Reference.COM 
  FREE Usenet and Mailing list archive, directory and clipping service 
  -------------------------------------------------------------------- 


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

Date: Thu, 01 Oct 1998 11:34:51 GMT
From: "Krzysztof Kunowski" <kyniu1@friko3.onet.pl>
Subject: haw copy file?
Message-Id: <vNJQ1.254$1f.44526@news.tpnet.pl>

Haw copy file form one dir to other in Perl?




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

Date: Thu, 1 Oct 1998 01:34:02 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Help with regular expression!!!
Message-Id: <1dg74j9.1h6xkb89hqxyN@bay1-156.quincy.ziplink.net>

<nguyen.van@imvi.bls.com> wrote:

> I have a little problem with regex. Below is my access file. I want to print
> out to a file with only "crno=number"(i.e crno=7035269) and
> "Mozilla/number.numbers"(i.e Mozilla/3.0). However, I just want to pick these
> out of lines without AOL number.numbers(i.e AOL 3.01) and MSIE
> number.numbers(i.e MSIE 4.02).

You're trying to do too much in one regex.

if (($crno)    = m!\b(crno=\d+)! and
    ($mozilla) = m!\b(Mozilla/\s*\d+\.\d+)!) {
  printf ("%10s %7s\n", $crno, $mozilla) unless /MSIE\s\d/ or /AOL\s\d/;
}

> printf HANDLE_NETSCAPE ("%10s %7s\n" ,$1, $2) if ( $_ =~
> /\b(crno=\d{2,})\b.*\b(Mozilla\\\d\.\d+)\b.*[^(MSIE\s\d\.\d+)].*[^(AOL\s\d\.\
> d+)]/);

This regex matches Mozilla\3.0, rather than Mozilla/3.0.

Because of the use of \b, it will not match if the Mozilla version is
4.5b1, as in your sample input.

Character classes just don't work like that.  [^xyz] means match a
single character other than x, y, or z.

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Thu, 01 Oct 1998 11:14:53 GMT
From: "Krzysztof Kunowski" <kyniu1@friko3.onet.pl>
Subject: make script for NT?
Message-Id: <NuJQ1.222$1f.39410@news.tpnet.pl>

I've got program in perl and I don't know haw compile it for Windows NT?




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

Date: 01 Oct 1998 10:13:23 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: multiple name-value pair
Message-Id: <83btnwvgws.fsf@vcpc.univie.ac.at>

Re: multiple name-value pair, Jas <Jas@my-dejanews.com>
said:

Jas> Is it possible to have more than one name-value entry
Jas> in a check box. My example is Day and Month in the same
Jas> box. Any help is appreciated.

this was off-topic the first time, reposting it doesn't
increase its relevance.  Try an HTML group.  Or actually
indicate how this has something to do with perl.

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien,  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: 01 Oct 1998 09:56:53 +0200
From: Michal Rutka <erhmiru@erh.ericsson.se>
To: uri@camel.fastserv.com
Subject: Re: Need IP Address Sort Subroutine
Message-Id: <lapvccyat6.fsf@erh.ericsson.se>

Uri Guttman <uri@camel.fastserv.com> writes:
> >>>>> "MR" == Michal Rutka <erhmiru@erh.ericsson.se> writes:
>   MR> Hym. Never heard about Memorize. It is not present in my
>   MR> distribution.
> 
> it's Memoize. no R. and it is on CPAN where all of the rest of perl
> resides besides your distribution.

Sorry, another typo. I know what CPAN is, and I know what standard distribution is and I 
know that when you have more than 100 computers on which your script must
run than much better is to use only a standard distribution.

> then why are you posting to this group? 

Just to have a little fun for now. Soon I will stop posting.

> and john was trying to help you
> improve your code and speed. 

No. It was another way around. He posted code with two bugs:
1. Integer overflow
2. Schwartzian thing.

I was trying to help him to see that there is another, safier (read portable) way
to do this.

> he had a minor bug. the transform is incredibly useful if you would take
> the 5 minutes to understand it.

If you need as much time as 5 minutes then...
It took me about 10 seconds to understand a syntax. I didn't found it pretty.
And one more thing, in a job which I do I learned to use a word 'transform' to
more complicated things than a simple data manipulation. That's why I call it
a Schwartzian thing.

> it is general purpose and has nothing to
> do with IP numbers. 

I would never guss.

[..]
> and what do you mean by integer conversion being banned syntax?

Well. Do you know that most bugs in embeded software are caused by an integer
overflow? Do you know that those bugs are very hard to find when the software
is in testing phase? Say, how long would you take to find an ineteger overflow
in John's code in this scenario:

1. He writes code, test it on his machine where it works OK.
2. You take it to the machine which has 32 bit signed integers... and bingo
   code does not work in a some wired way.

Think about it.

Regards,


Michal

> 
> uri
> 
> -- 
> Uri Guttman                  Fast Engines --  The Leader in Fast CGI Technology
> uri@fastengines.com                                  http://www.fastengines.com


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

Date: Thu, 01 Oct 1998 09:10:59 BST
From: gml4410@ggr.co.uk (Lack Mr G M)
Subject: Re: Need IP Address Sort Subroutine
Message-Id: <1998Oct1.091059@ukwit01>

In article <lapvccyat6.fsf@erh.ericsson.se>, Michal Rutka <erhmiru@erh.ericsson.se> writes:
|> > 
|> > it's Memoize. no R. and it is on CPAN where all of the rest of perl
|> > resides besides your distribution.
|> 
|> Sorry, another typo. I know what CPAN is, and I know what standard distribution is and I 
|> know that when you have more than 100 computers on which your script must
|> run than much better is to use only a standard distribution.

   No it isn't.  The much MUCH better thing to do is to get all of these
systems to use a *single* distribution.  That's what network file
systems are for.  Then you just have to install additional modules once
and they appear on all systems.

   There is far more to administering systems than writing Perl - you
also need to know how to make the admin simple by using the available
options. 

|> It took me about 10 seconds to understand a syntax. I didn't found it pretty.
|> And one more thing, in a job which I do I learned to use a word 'transform' to
|> more complicated things than a simple data manipulation. That's why I call it
|> a Schwartzian thing.

   I suggest you look up transform in a dictionary.


-- 
----------- Gordon Lack ----------------- gml4410@ggr.co.uk  ------------
The contents of this message *may* reflect my personal opinion.  They are
*not* intended to reflect those of my employer, or anyone else.


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

Date: Thu, 01 Oct 1998 09:52:24 BST
From: gml4410@ggr.co.uk (Lack Mr G M)
Subject: Re: Need IP Address Sort Subroutine
Message-Id: <1998Oct1.095224@ukwit01>

In article <361269E7.CF04E3B9@min.net>, John Porter <jdporter@min.net> writes:
|> For anyone who may be interested...
|> I have performed some benchmarks, and based on the results,
|> I make the following observations.
|> 
|> 1. Michal gave the following formula for converting a dotted-quad
|>    string into a string of four chars:
|>       pack( "C4", split(/\./,$_) )
|>    This is so fast that memoization has no effect.

   However, the address format for IP does not require you to use 4
fields, you can also specify network.host.  This is why it is better to
use inet_aton, since it handles this. 

   Eg:  127.1 is the same as 127.0.0.1
        172.16.3          -> 172.16.0.3
        172.16.56239      -> 172.16.219.175

   You may not use this, but why not make use of the code which is
already written that *can* handle it?  Stop re-inventing the wheel (or
rather, in this case, re-inventing it as an arc!).


----------- Gordon Lack ----------------- gml4410@ggr.co.uk  ------------
The contents of this message *may* reflect my personal opinion.  They are
*not* intended to reflect those of my employer, or anyone else.


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

Date: Thu, 01 Oct 1998 03:12:16 -0700
From: "Phinneas G. Stone" <phinneas@eskimo.com>
Subject: passing javascript vars to CGI
Message-Id: <36135580.B1F7EF63@eskimo.com>

Is it possible to process a variable with javascript, then pass that
value along to a CGI script? What I'm trying to do is preserve the line
breaks in a <textarea> by encoding with the javascript escape() function
and decoding them with perl once the form has been submitted.




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

Date: Wed, 30 Sep 1998 21:42:58 -0400
From: "Joe Williams" <willliams@clark.net>
Subject: Problems Using a Compare Subroutine with Sort
Message-Id: <6uvo69$tah$1@callisto.clark.net>

I need to sort array strings by the IP address that each string contains.
John Porter posted a clever routine to covert the dotted quad address into
an integer. The normal Perl sort permits calling a subroutine to do the
comparison. So, I can just use index and substr to lift the IP addresses out
of the strings being compared, which sort passes to the subroutine by
reference in the variables $a and $b, convert them into integers, compare
the integers and return 0, -1, or 1 to the sort routine. In principal, $a
and $b arn't changed.

However, I'm not getting good results, possibly because of scope problems
with the way sort passes arguments in the global variables $a and $b by
reference.

I'm haven't isolated the subroutine variables in a package, so I don't think
that is a problem.

Does anyone know a safe way to write a comparison subroutine that does some
processing on the strings that are passed? Is there a standard way to manage
sort subroutine variables in such cases?

Many TXs.




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

Date: 1 Oct 1998 07:59:52 GMT
From: "Noli C." <nospam@nospam.com>
Subject: return code
Message-Id: <01bded1a$47eba4c0$348267a1@echamw030384.ham.ec.bp.com>

My Script does some forks and system calls. It works like expected but
returns 141 to the shell allthough the last command is "exit 0" and the
script definitely reaches this point.
What does 141 mean?
Where do I get general information about perls exit status' ?

Thank you for answering
Hanno


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

Date: Thu, 01 Oct 1998 10:57:21 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: Re: Rotating an array.
Message-Id: <361554b6.4947259@news.ping.be>

Casper Kvan Clausen wrote:

>The problem is this: Given an array A of n elements, how do you most
>efficiently construct a new array B containing the same elements, but
>rotated so that B[0] = A[n-m], B[1] = A[n-m+1] ... B[m] = A[n]?

I'm not sure I quite understand the specification, but this is my first
thought:

	@b = (@a,@a)[$m .. $m+$#a];

	Bart.


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

Date: Thu, 01 Oct 1998 08:57:25 GMT
From: daniel@intecomp.com (Daniel Pray)
Subject: two subroutines depending on whether d/l complete or not
Message-Id: <daniel-0110980158130001@usr23-dialup49.mix1.sacramento.cw.net>

I want to run two subroutines depending on whether a d/l is completed or
not.  Does any one know how to do this?

This is what I'm doing now.  It is used for clients to download a file
from a web site form after clicking submit.

>   >> my $name  = "filexxxxx";
>   >> open(FILE, $name);
>   >> print "Content-Type: application/x-stuffit\n";
>   >> print "Location: $name\n\n";
>   >> close FILE;
> 

eg. 
sub emailerror;
open MAIL;

sub success;
open MAIL;

Any help would be appreciated?

Thanks,

Daniel


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

Date: Thu, 01 Oct 1998 05:40:51 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: What is HFB?
Message-Id: <36131370.F1284DA4@bbnplanet.com>

Here, for all those freaks who have mailed me asking 'WTF if HFB' this
is the transcript of the SNL commercial from way back when it used to be
funny. Enjoy.

-----
Happy Fun Ball

(kids)
It's Happy!
It's Fun!
It's Happy Fun Ball!

(announcer)
Yes, it's Happy Fun Ball,
the toy sensation
that's sweeping the nation.
Only 14.95 at participating stores!

Get one Today

(background voice)
Warning: Pregnant women, the elderly, and children should avoid
prolonged exposure to Happy Fun Ball.

Caution: Happy Fun Ball may suddenly accelerate to dangerous speeds.

Happy Fun Ball contains a liquid core, which if exposed due to rupture
should not be touched, inhaled, or looked at.

Do not use Happy Fun Ball on concrete.

Discontinue use of Happy Fun Ball if any of the following occurs:

* Itching
* Vertigo
* Dizziness
* Tingling in extremities
* Loss of balance or coordination
* Slurred speech
* Temporary blindness
* Profuse Sweating
or
* Heart palpitations

If Happy Fun Ball begins to smoke, get away immediately.  Seek shelter
and cover head.

Happy Fun Ball may stick to certain types of skin.

When not in use, Happy Fun Ball should be returned to its special
container and kept under refrigeration.

Failure to do so relieves the makers of Happy Fun Ball, Wacky Products
Incorporated, and its parent company, Global Chemical Unlimited, of any
and all liability.

Ingredients of Happy Fun Ball include an unknown glowing substance which
fell to Earth, presumably from outer space.

Do not taunt Happy Fun Ball.

Happy Fun Ball comes with a lifetime guarantee.

(announcer)
Happy Fun Ball!  Accept no substitutes!

e.

"All of us, all of us, all of us trying to save our immortal souls, some
ways seemingly more round-about and mysterious than others. We're having
a good time here. But hope all will be revealed soon."  R. Carver


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

Date: Thu, 01 Oct 1998 11:28:11 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: What is HFB?
Message-Id: <36136638.602629124@news.mmc.org>

[ posted to comp.lang.perl.misc and a courtesy copy was mailed to the cited
author ]

On Thu, 01 Oct 1998 05:40:51 GMT, Elaine -HappyFunBall- Ashton
<eashton@bbnplanet.com> wrote:

>Here, for all those freaks who have mailed me asking 'WTF if HFB' this
>is the transcript of the SNL commercial from way back when it used to be
>funny. Enjoy.

Whew. Thank God. All along I was thinking it was simply some thinly-veiled
sexual innuendo thing.

And, of course, that you were bragging . . . ;-)






PS. Yes, I know, pretty twisted . . . but I have no life. Sorry.
-- 
                               Jeffrey R. Drumm, Systems Integration Specialist
                       Maine Medical Center - Medical Information Systems Group
                                                            drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me


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

Date: Thu, 1 Oct 1998 09:39:01 +0200
From: "Stuart Thorn" <stuart@euronova.com>
Subject: Re: Word wrap for Perl
Message-Id: <6uvbgm$ga2$1@buggy.easynet.fr>

Look on CPAN for Text::Wrap
Simpler than Text::Format

--------------------
use Text::Wrap qw(wrap $columns);


$columns = 40; # or whatever

my $longString = q'>I am looking for just some function that will take a
string that is
>multiline. And I give it a delimeter of 72, the size of the string to
>word wrapping. Can anyone help me?
>
>Justin Archie
>';

my $wrappedString = wrap( '', '', $longString );




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

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


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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