[6933] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 558 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 2 14:17:19 1997

Date: Mon, 2 Jun 97 11:00:29 -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           Mon, 2 Jun 1997     Volume: 8 Number: 558

Today's topics:
     Re: 2-way communication with unix command (Jonathan Hudson)
     Re: 5.004 problem with Hashes <eike.grote@theo.phy.uni-bayreuth.de>
     Announce: The Perl Wish List (Alan Olsen)
     Re: any editor for perl?--any editor written in Perl? (O'Shaughnessy Evans)
     Re: any editor for perl? (Kyzer)
     Re: Bored?  Want to evaluate my first (usefull) perl sc (Chipmunk)
     Re: Command line args (Nathan V. Patwardhan)
     Converting number to ascii (Ernie Dunbar)
     Re: Converting number to ascii <seay@absyss.fr>
     data structure question (Jon Nathan)
     Re: filter out uids below 100 (Chipmunk)
     Re: HELP for  PERL 5.003 under AIX (Kent Perrier)
     Re: Help, embeding perl in C++ <rootbeer@teleport.com>
     Re: LOG base 10  operator <eike.grote@theo.phy.uni-bayreuth.de>
     moving form BSD to SunOS 5.5  (formmail.pl) <henry@uninet.com.br>
     Re: newbie question about the sort function and hashes (Jeff Robertson)
     Re: newbie question about the sort function and hashes <rootbeer@teleport.com>
     Perl, TK, CGI <drosen@austx.tandem.com>
     Re: Perl, TK, CGI <rootbeer@teleport.com>
     Re: Protecting perl code *Important* (Hope this helps!)
     Setting a variable for both split and join... (CHAN TANG Eric-Aubert)
     Re: Setting a variable for both split and join... (Tung-chiang Yang)
     Re: Tutorial Needed (wrong URL ?) <eike.grote@theo.phy.uni-bayreuth.de>
     Re: while(<>) and perl -e: B.. or feature? (Jeff Robertson)
     Re: while(<>) and perl -e: B.. or feature? (Chipmunk)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 1 Jun 1997 20:50:19 GMT
From: Jonathan.Hudson@jrhudson.demon.co.uk (Jonathan Hudson)
Subject: Re: 2-way communication with unix command
Message-Id: <5msnab$3dn@trespassersW.local>

In article <8cpvu6tjm3.fsf@gadget.cscaper.com>,
	Randal Schwartz <merlyn@stonehenge.com> writes:

>Well, I could argue that in this case "the vendor" is the Perl
>development team (guided by Larry), or even "The Perl Institute".  Any
>"ready to release" version is an approved ehancement... just stay away
>from the development releases.

I wouldn't argue with that, and as I was fortunately able to blow away
the delivered perl 4.036 with 5.004 fresh off CPAN very quickly, it
wasn't a problem. It may be rather unfair to Sun and HP to single out
particular vendors, but I'm rather surprised that they still appear to
include such obsolete releases.

The intention was to note that the people who post 'perl4' requests
here may not be constrained by laziness or ignorance, but rather
 
>Pointy-haired managers.  <sigh>

-- 
 -----------------------------------------------------------------------
 Jonathan R Hudson                       Email: jrh@jrhudson.demon.co.uk
 WWW: http://www.jrhudson.demon.co.uk    Voice/Fax: +44 (0)1703 867843



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

Date: Mon, 02 Jun 1997 16:12:42 +0200
From: Eike Grote <eike.grote@theo.phy.uni-bayreuth.de>
Subject: Re: 5.004 problem with Hashes
Message-Id: <3392D4DA.41C6@theo.phy.uni-bayreuth.de>

Hi,

Prince Mystery wrote:
> 
> I'm getting an error that I didn't used to get when the system was on
> the previous version of perl (5.003):
> 
> Odd number of elements in hash list at...
> 
> Over the line:
> 
> %final = {};

Unfortunately I naven't installed perl 5.004 here (yet ...), but
my advice: Try

  %final = ();
           ^^


Bye, Eike
-- 
======================================================================
 Eike Grote, Theoretical Physics IV, University of Bayreuth, Germany
----------------------------------------------------------------------
 e-mail -> eike.grote@theo.phy.uni-bayreuth.de
 WWW    -> http://www.phy.uni-bayreuth.de/theo/tp4/members/grote.html 
           http://www.phy.uni-bayreuth.de/~btpa25/
======================================================================


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

Date: 2 Jun 1997 14:40:25 GMT
From: webmaster@perl.org (Alan Olsen)
Subject: Announce: The Perl Wish List
Message-Id: <5mum0p$fif$1@nadine.teleport.com>

-----BEGIN PGP SIGNED MESSAGE-----


The Perl Institute would like to announce a new feature at the Perl
Institute Web Site:

The Perl Wish List  <http://www.perl.org/wishlist.html>

The purpose of the Wish List is to give a place for the Perl community
at large to make suggestions as to how to make Perl more useful for
everyone.  As projects are identified, the Perl Institute will help
organize volunteers and resources to make those ideas become reality.

For more information about The Perl Institute, view our web page at
<http://www.perl.org/> or send mail to our infobot at info@perl.org.



-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQEVAwUBM5ByvSHKgQer03QZAQHOrwf+POS+r/EzeYgc29C4Xt109UsA8i17Hdoc
clzl86U5Ia16FgJT++XsPZ8BoQ8vz/07WOHVu2y50kcuocYnkVwGcG1QfRqQcvSM
8kfBR+etYAFoTZEcEimAq04m3U2LYU1+wFeYuXZUufJo2UK+G7R1SxNYzK289E6e
GAG9uO9+vi2v9THwtMPrAUxGQlSMlMRFfNaIuQyh8GnCKbxJAJhmEYxFfjWS7Jvm
dpRRxHB93+caqRqK7rG7YzEUb9ex0GCMBVW4lVVYV8OpwEswhQMR3RGGfg9V2ljW
8g89kkjetBavUQe0sWRdzTXZS2grtUO9+iQbe+8/iKs4A5j8jNS+Ug==
=bvAz
-----END PGP SIGNATURE-----

Alan Olsen             "Mi Tio es infermo, pero la carretera es verde!"
Webmaster               
The Perl Institute                   
webmaster@perl.org                    




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

Date: 2 Jun 1997 17:21:06 GMT
From: shaug@callamer.com (O'Shaughnessy Evans)
Subject: Re: any editor for perl?--any editor written in Perl?
Message-Id: <5muve2$k9d$1@zinger.callamer.com>

In article <oee3er3k8s3.fsf@alpha.hut.fi>,
	Jarkko Hietaniemi <jhi@alpha.hut.fi> writes:
> 
>I did some rewording now but I am not certain was it for worse or for better:
> 
>      and for some auxiliary utilities having to do with Perl
>      or using Perl in some way or another
> 
> Regards,
> 	The Self-Appointed Master Librarian of CPAN
 
 Hey, that's really cool!  I think it's much more clear.  Plus, it means
 I have a valid opinion, and that's always nice   *8)=

 Thanks,
	A Self-Appointed Average User of CPAN


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

Date: 2 Jun 1997 16:51:37 GMT
From: junkmail@sysa.abdn.ac.uk (Kyzer)
Subject: Re: any editor for perl?
Message-Id: <5mutmp$36o@info.abdn.ac.uk>

Tom Phoenix of rootbeer@teleport.com wrote in comp.lang.perl.misc:
: So, you have a "do what I mean" tab key? Must be a "smart terminal". 

I often want one of those... I keep expecting tab-completion to work
on my perl scripts... but TAB in an editor always means tab, it's some
other key sequence to complete a statement...

--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac   |My opinions aren't those of Aberdeen |Amiga -
kyzer@4u.net kyzer@hotmail.com  |University or AUCC, thankfully.***** |always!

-- 
Random sig of the day:
My other sig is a Ford Fiesta


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

Date: 2 Jun 1997 15:54:50 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: Bored?  Want to evaluate my first (usefull) perl script?
Message-Id: <5muqca$prl$2@dartvax.dartmouth.edu>

In article <m3aflb2mxx.fsf@windlord.Stanford.EDU>
Russ Allbery <rra@stanford.edu> writes:

> BTW, how much of a speed penalty do -w and use strict cause?

Aren't they only factors when the script is being compiled?

Chipmunk


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

Date: 2 Jun 1997 15:45:33 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Command line args
Message-Id: <5mupqt$57e@fridge-nf0.shore.net>

Greg McNichol (mcnichol@mcs.net) wrote:

: I am a Perl "newbie" currently working my way through the SAM's book:
: _Teach Yourself Perl 5 in 21 Days_. Up until this point I have written
: DOS batch files to enable end users basic file copy capabilities from

Wow.  Your book doesn't discuss file copying?  That's, err, dreadful.
:-)

Here's a few things to look into:
(1) The File::Copy module.
(2) The system() call.
(3) Filehandles.

Also, play with @ARGV which holds your command-line arguments, as well
as the Getopt modules.

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: 2 Jun 1997 16:22:50 GMT
From: grimm@shell.pgonline.com (Ernie Dunbar)
Subject: Converting number to ascii
Message-Id: <5mus0q$9o4@usenet85.supernews.com>


Well, the title pretty much sums it up. I need to know how to change a
numeric value into ascii.

----------------------------- IXTJ at large ------------------------------
         De Iesus domine           | grimm@netbistro.com - BOFH in 
       Dom a Hades requiem         | training and voted by my co-workers 
                                   | "Most Likely to Go Postal"
-If you send me spam, I will decimate your account. Resistence is futile.-



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

Date: Mon, 02 Jun 1997 18:43:44 +0200
From: Douglas Seay <seay@absyss.fr>
Subject: Re: Converting number to ascii
Message-Id: <3392F840.3A5DDC6B@absyss.fr>

Ernie Dunbar wrote:
> 
> Well, the title pretty much sums it up. I need to know how to change a
> numeric value into ascii.

As Perl doesn't make too much of a distinction here, I wonder what you
are trying to do.  "print" usually does the job.

- doug


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

Date: 2 Jun 1997 16:00:30 GMT
From: jn0729a@cage.cas.american.edu (Jon Nathan)
Subject: data structure question
Message-Id: <5muqmu$l0b$1@paladin.american.edu>


hello
i'm trying to write a quoteserver script.  ultimately, it will print 
out a random quote and allow users to guess the origin of the quote.  
the script will read in a text file formatted as such:

1.Take me out to the ballgame.
1.some song
2.oh say can you see
2.another song whatever

etc.  the format of the textfile isn't at all set, but it sounded good 
to me at the time.  once it reads in all the quotes from the file, it 
should pull one at random and print it out.  my code so far to do this 
is really ugly..

------start code-------

open(QUOTES, "//usr//people//nathanj//quotes");

while ($quote=<QUOTES>){
	chop($quote);       #get a line from the file
        $num=/$(\d+\.)/;    #digit(s) followed by a period
	$quote=~s/\1//;     #take the digit(s) and period out
	
	chop($source);      #get the next line from the file
	$source=~s/\$1//;   #take the digit(s) and perious out

	@\$1=($quote,$source);  #make an array called (the number of the quote)
				#that holds the quote and its source

 	%fullquote={		#then make a hash called %fullquote
				#that's indexed by (the number of the quote)
				#and points to the array with the 
associated 
				#number
		$1 => \@\$1,
	}

}
#now pick a random key from the @fullquote array 
#and print out the quote associated with that number
#later i'll deal with the source of the quote

#put all the keys into another array - this probably isn't necessary
#but i didn't know how better to do it
@possibilities = keys (@fullquote);

#now choose a random one from @possibilities
#not sure exactly how yet

print"  ";  #print out the quote associated with the random key
}

------end code-----

so far this code is obviously very ugly and doesn't work.  any advice 
on how to beautify/simplify/make it work would be appreciated.  please 
cc a reply to my email if you would.  also, sorry if this is posted 
twice.

thank you

--
Jon Nathan
jon@blading.com
www.csis.american.edu/~jn0729a


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

Date: 2 Jun 1997 15:52:00 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: filter out uids below 100
Message-Id: <5muq70$prl$1@dartvax.dartmouth.edu>

In article <33906FBB.23E@babylon5fan.com>
Keys <keys@babylon5fan.com> writes:

> while(($login,$passwd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell)=getpwent)
> {
>                 ($name,$office,$phone)=split(/,/,$gcos);
>                 $username{$login}=$name;
> }
> for (sort keys %username) {
>                 print "<LI> <A
> HREF=\"/bwarden/fingerm?$_\">$username{$_} ($_)<$
>                 if (-r "/home/httpd/html/$_/index.html") {
>                         print "<font size=\"-2\"><A
> HREF=\"/$_/\">homepage</A><$
>                         }
> }
> 
> 
> I thought I could add something like:
> 
> for ($uid > 100) {
> <code from above>
> }

What you want is the line:

next if $uid <= 100;

as the first line in the while loop.

Chipmunk


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

Date: 02 Jun 1997 12:06:48 -0500
From: kperrier@Starbase.NeoSoft.COM (Kent Perrier)
Subject: Re: HELP for  PERL 5.003 under AIX
Message-Id: <csiuzxrl1z.fsf@Starbase.NeoSoft.COM>

In article <01bc6ea9$babe66e0$5d50f684@pc93.cisti.nrc.ca> 
"Walter Boev" <walter.boev@nrc.ca> writes:

>X-Newsreader: Microsoft Internet News 4.70.1155

Ah, so this is why your post is so poorly formatted.  Please use a monospaced
font next time.

>
>
>Hi all,
>
>	I am trying to compile PERL 5.003 under AIX on two  IBM Risc 6000
>computers
>	I am running AIX 4.14. I have successfuly compiled on one machine by using
>	all the stantard defaults. However on the other machine I keep getting the
>following
>	error when I run make.
>

<SNIP>

Why are you compiling it again?  Are you running two differnet versions of
AIX?  Just tar up perl source tree, ftp to the other machine, untar it
and type make install.

BTW, go out and get 5.004 since it is out now.

Kent
-- 
Kent Perrier           If Bill Clinton is the answer, then it must
kperrier@neosoft.com    have been a really stupid question.
Corporations don't have opinions, people do.  These are mine.
PGP 2.6 Public Key available by request and on key servers
PGP encrypted mail preferred!



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

Date: Mon, 2 Jun 1997 09:29:18 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Larry D'Anna <ldanna@ix.netcom.com>
Subject: Re: Help, embeding perl in C++
Message-Id: <Pine.GSO.3.96.970602092841.21567E-100000@kelly.teleport.com>

On Sun, 1 Jun 1997, Larry D'Anna wrote:

> Does anyone know how to embed perl functions in C/C++? 

Have you tried the perlembed manpage? :-)

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Mon, 02 Jun 1997 16:19:35 +0200
From: Eike Grote <eike.grote@theo.phy.uni-bayreuth.de>
Subject: Re: LOG base 10  operator
Message-Id: <3392D677.167E@theo.phy.uni-bayreuth.de>

Hi,

Michael J. Rocchetti wrote:
> 
> Does anyone know how to take the log base 10 of a number using PERL?

Yes, I think I do ... ;-)


Mathematical way (can be used for any base):

   $a = 1_000_000;
   $l = log($a)/log(10);   # yields 6

POSIX-way:

   use POSIX;
   $a = 1_000_000;
   $l = log10($a);         # yields 6, too


Bye, Eike
-- 
======================================================================
 Eike Grote, Theoretical Physics IV, University of Bayreuth, Germany
----------------------------------------------------------------------
 e-mail -> eike.grote@theo.phy.uni-bayreuth.de
 WWW    -> http://www.phy.uni-bayreuth.de/theo/tp4/members/grote.html 
           http://www.phy.uni-bayreuth.de/~btpa25/
======================================================================


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

Date: Mon, 02 Jun 1997 14:20:27 +0100
From: Henry Hazan <henry@uninet.com.br>
Subject: moving form BSD to SunOS 5.5  (formmail.pl)
Message-Id: <3392C89B.2161@uninet.com.br>

Is there anyone to answer me why I am having problems to run this script
on sunOs 5.5. I get the message: [Mon Jun  2 10:54:21 1997] httpd:
malformed header from script
[Mon Jun  2 10:55:25 1997] httpd: caught SIGTERM, shutting down

Thank you!
Henry Hazan <henry@uninet.com.br>

#!/usr/bin/perl
######################
# General Mail Form To Work With Any Fields
# Created 6/9/95                Last Modified 6/11/95
# Version 1.0

# Define Variables
$mailprog = '/bin/sendmail';
$date = `/bin/date`; chop ($date);

######################
# Necessary Fields in HTML Form:   
# recipient = specifies who mail is sent to
# username = specifies the remote users email address for replies
# realname = specifies the remote users real identity
# subject = specifies what you want the subject of your mail to be

# Print the Initial Output Heading
print "Content-type: text/html\n\n";

# Get the input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});

# Split the name-value pairs
@pairs = split(/&/, $buffer);

foreach $pair (@pairs)
{
    ($name, $value) = split(/=/, $pair);

    # Un-Webify plus signs and %-encoding
    $value =~ tr/+/ /;
    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
    $name =~ tr/+/ /;
    $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

    # Stop people from using subshells to execute commands
    # Not a big deal when using sendmail, but very important
    # when using UCB mail (aka mailx).
    # $value =~ s/~!/ ~!/g;

    # Uncomment for debugging purposes
    # print "Setting $name to $value<P>";

    $FORM{$name} = $value;
}

# Print Return HTML
print "<html><head><title>Obrigado !</title></head>\n";
print "<body><h1>Obrigado !</h1>\n";
print "$date<hr>\n";

# Open The Mail
open (MAIL, "|$mailprog $FORM{'recipient'}") || die "Can't open
$mailprog!\n";
print MAIL "From: $FORM{'username'} ($FORM{'realname'})\n";
print MAIL "Reply-To: $FORM{'username'} ($FORM{'realname'})\n";
print MAIL "To: $FORM{'recipient'}\n";
print MAIL "Subject: $FORM{'subject'}\n\n";
print MAIL "Below is the result of your feedback form.  It was submitted
by $FORM{'realname'} ($FORM{'username'} on $date\n";

foreach $pair (@pairs)
{
    ($name, $value) = split(/=/, $pair);
 
    # Un-Webify plus signs and %-encoding
    $value =~ tr/+/ /;
    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
    $name =~ tr/+/ /;
    $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

    # Stop people from using subshells to execute commands
    # Not a big deal when using sendmail, but very important
    # when using UCB mail (aka mailx).
    # $value =~ s/~!/ ~!/g;

    # Uncomment for debugging purposes
    # print "Setting $name to $value<P>";

    $FORM{$name} = $value;

# Print the MAIL for each name value pair
  print MAIL "$name:  $value\n";

# Print the Return HTML for each name value pair.
  print "$value<hr>\n";
}
close (MAIL);

print "</body></html>";


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

Date: 2 Jun 1997 10:05:15 -0500
From: jrobert1@guardian.cba.ua.edu (Jeff Robertson)
Subject: Re: newbie question about the sort function and hashes
Message-Id: <5munfb$dtn@guardian.cba.ua.edu>

In article <339264fe.17052439@news.tamu.edu>,
Shane 'Fishman' Sherman <fishman@vvm.com> wrote:
>What i am trying to do is sort a hash by the keys but then print the
>whole hash sorted and not just the keys...here is my code:
>
>
>print"How many lakes: ";
>$numlakes=<STDIN>;
>for($i=0;$i<$numlakes;$i+=1){
>        print "Name of lake: ";
>        $name=<STDIN>;
>        chomp($name);
>        $name=$name." - ";
>        print "\ndescription? ";
>        $info=<STDIN>;
>        $lakeinfo{$name}.=$info . " ";
>        }
>@sort = sort %lakeinfo;
>print @sort;
>
>

The manpage 'perlfunc' has an example of the 'keys'
function that does what you want. Here's something
like it, applied to your example:

# iterate through the sorted list of keys
foreach $_ (sort keys %lakeinfo)
{
	#now, $_ is the name of the current lake
	print "Name of Lake: $_\n";
	
	#use it to index the hash
	print "Description: $lakeinfo{$_}";
}

-- 
Jeff Robertson <jrobert1@midgard.cba.ua.edu>, <jroberts@sss.cba.ua.edu>
Consultant, Webmaster - System Support Services, C&BA, U of Alabama
Visit My Railroad Page: http://www.cba.ua.edu/~jrobert1/rail


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

Date: Mon, 2 Jun 1997 09:39:19 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Shane 'Fishman' Sherman <fishman@vvm.com>
Subject: Re: newbie question about the sort function and hashes
Message-Id: <Pine.GSO.3.96.970602093049.21567F-100000@kelly.teleport.com>

On Mon, 2 Jun 1997, Shane 'Fishman' Sherman wrote:

> Subject: newbie question about the sort function and hashes

Contrary to popular belief, it's not important to announce in the subject
line that yours is a "newbie question". Usually that's obvious from the
question alone. :-) 

> What i am trying to do is sort a hash by the keys but then print the
> whole hash sorted and not just the keys...

    @sorted_keys = sort keys %hash;
    for (@sorted_keys) { print "$_ => $hash{$_}\n" }

> print"How many lakes: ";
> $numlakes=<STDIN>;
> for($i=0;$i<$numlakes;$i+=1){
>         print "Name of lake: ";
>         $name=<STDIN>;
>         chomp($name);

This is a somewhat unPerlish way of doing this. A more Perlian way might
be something like this.

    while (1) {
      print "Enter a lake name (<CR> on empty line to end input) : ";
      chomp($name=<STDIN>);
      last unless defined $name;
      ...

> @sort = sort %lakeinfo;

Ooh, that's not what you want. You're mixing the keys with the values!

Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Mon, 02 Jun 1997 11:28:30 -0500
From: David Rosen <drosen@austx.tandem.com>
Subject: Perl, TK, CGI
Message-Id: <3392F4AE.2781E494@austx.tandem.com>

OK folks, I need some help.  My problem is I have a logfile with
percentages and times and want a graphical representation.  I was
planning on using perl and Tk, but if there is a simple Java program I
am more than willing to look at it too.  Are there any perl programs
prewritten or maybe one I can modify for this task?

Thanks,
Dave Rosen
drosen@austx.tandem.com


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

Date: Mon, 2 Jun 1997 10:27:33 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: David Rosen <drosen@austx.tandem.com>
Subject: Re: Perl, TK, CGI
Message-Id: <Pine.GSO.3.96.970602102631.21567K-100000@kelly.teleport.com>

On Mon, 2 Jun 1997, David Rosen wrote:

> I have a logfile with percentages and times and want a graphical
> representation. 

With Perl, you can parse the file, tabulate the data, and use the GD
module (or other modules) to draw graphs.

Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: 2 Jun 1997 11:35:22 -0500
From: scribble@shoga.wwa.com (Hope this helps!)
Subject: Re: Protecting perl code *Important*
Message-Id: <5musoa$d3p@shoga.wwa.com>

Carl Eklof  <noasat@acm.vt.edu> wrote:
>How does one protect perl code.
>
>I have a very serious issue; I am selling some code that I wrote and
>would like to protect it against copying, etc. I have heard that there
>are ways to convert perl into its binary form. Is that true? That would
>certainly solve my problem.

In addition to what everyone else has said-- there is the Filter
module on CPAN. With it, you might be able to encrypt the source.

I have never used it.



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

Date: 2 Jun 1997 15:54:49 GMT
From: chantane@JSP.UMontreal.CA (CHAN TANG Eric-Aubert)
Subject: Setting a variable for both split and join...
Message-Id: <5muqc9$56k@epervier.CC.UMontreal.CA>


Here's an example (non working) for what I'm looking for:

$SEPARATOR = '|';

$string = join($SEPARTOR, @text);

@text = split(/$SEPARATOR/, $text);

This won't work because, 'split' should be call this way:
@text = split(/\|/, $text);


Any clue?
-- 
  ____________________________________________________________
   (3/1R&() Eric-Aubert Chan Tang <chantane@JSP.UMontreal.CA>
            http://www.jsp.umontreal.ca/~chantane/


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

Date: Mon, 2 Jun 1997 16:47:57 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: Setting a variable for both split and join...
Message-Id: <199706021647.JAA12945@netcom10.netcom.com>

I am not sure if you can use SEPARATOR this way, but I would remind you
that you might want to use $string in the split command, not $text :)

===================================
CHAN TANG Eric-Aubert (chantane@JSP.UMontreal.CA) wrote:

: Here's an example (non working) for what I'm looking for:

: $SEPARATOR = '|';

: $string = join($SEPARTOR, @text);

: @text = split(/$SEPARATOR/, $text);

: This won't work because, 'split' should be call this way:
: @text = split(/\|/, $text);

--
Tung-chiang Yang                       tcyang@netcom.com

soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
   http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml



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

Date: Mon, 02 Jun 1997 17:53:24 +0200
From: Eike Grote <eike.grote@theo.phy.uni-bayreuth.de>
Subject: Re: Tutorial Needed (wrong URL ?)
Message-Id: <3392EC74.794B@theo.phy.uni-bayreuth.de>

James T. Bucks wrote:
> 
> Andy Birkett wrote:
> >
> > Are there any good Perl tutorials on the net.  If so could someone
> > please point me in the right directions.
> >
> > Thanks
> > --
> > Andy Birkett
> 
> Check out http://www.randysoft.com
            ^^^^^^^^^^^^^^^^^^^^^^^^

Oops ...


   While trying to retrieve the URL: http://www.randysoft.com/ 

   The following error was encountered: 

        DNS name lookup failure 

   The system returned: 

       DNS Domain 'www.randysoft.com' is invalid: Host not found
(authoritative).

   This means that: 

       The named host probably does not exist.



Bye, Eike
-- 
======================================================================
 Eike Grote, Theoretical Physics IV, University of Bayreuth, Germany
----------------------------------------------------------------------
 e-mail -> eike.grote@theo.phy.uni-bayreuth.de
 WWW    -> http://www.phy.uni-bayreuth.de/theo/tp4/members/grote.html 
           http://www.phy.uni-bayreuth.de/~btpa25/
======================================================================


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

Date: 2 Jun 1997 10:26:50 -0500
From: jrobert1@guardian.cba.ua.edu (Jeff Robertson)
Subject: Re: while(<>) and perl -e: B.. or feature?
Message-Id: <5muonq$e10@guardian.cba.ua.edu>

In article <3390C5A8.260A@blacksun.com>,
Michael Schilli  <mschilli@blacksun.com> wrote:
>Hi,
>
>I wonder why 
>
>   perl -e 'while(<>) {...}'
>
>doesn't process file names from the command line just as 
>
>   #!/usr/bin/perl 
>
>   while(<>) { ...
>   }
>
>does but instead insists on input from STDIN. Any ideas?

See the manual page 'perlrun' or your nearest Perl book...

The -e switch alone doesn't emulate a while(<>) loop.  A combination of
the -e and -n (or possibly -p) switches is probably what you want.


-- 
Jeff Robertson <jrobert1@midgard.cba.ua.edu>, <jroberts@sss.cba.ua.edu>
Consultant, Webmaster - System Support Services, C&BA, U of Alabama
Visit My Railroad Page: http://www.cba.ua.edu/~jrobert1/rail


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

Date: 2 Jun 1997 15:57:20 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: while(<>) and perl -e: B.. or feature?
Message-Id: <5muqh0$prl$3@dartvax.dartmouth.edu>

In article <3390C5A8.260A@blacksun.com>
Michael Schilli <mschilli@blacksun.com> writes:

> I wonder why 
> 
>    perl -e 'while(<>) {...}'
> 
> doesn't process file names from the command line just as 
> 
>    #!/usr/bin/perl 
> 
>    while(<>) { ...
>    }
> 
> does but instead insists on input from STDIN. Any ideas?

It accepts file names from the command line for me.

perl -e 'while (<>) {...}' file1 file2

Chipmunk


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

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

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