[10558] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4150 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 4 16:08:52 1998

Date: Wed, 4 Nov 98 13:00:52 -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, 4 Nov 1998     Volume: 8 Number: 4150

Today's topics:
        camel races on CNN <uri@fastengines.com>
        Decimal to Hex conversion (Eric Hagen)
    Re: Decimal to Hex conversion <uri@fastengines.com>
    Re: Decimal to Hex conversion (Eric Hagen)
    Re: Difference between netscape and microsoft cgi handl <rootbeer@teleport.com>
    Re: From Unix to WinNT <rootbeer@teleport.com>
    Re: Help please <rootbeer@teleport.com>
    Re: Help: Shared memory block as hash of hash <rootbeer@teleport.com>
    Re: Help: Shared memory block as hash of hash (John Hardy)
        How do you delete files in a directory? <dazimi@oradev.csis.csd.metrotor.on.ca>
    Re: How do you delete files in a directory? <tchrist@mox.perl.com>
    Re: How does xyz.pl?go=100 links work ? <rootbeer@teleport.com>
        How to capture the result of nslookup <dazimi@oradev.csis.csd.metrotor.on.ca>
    Re: How to capture the result of nslookup <rootbeer@teleport.com>
        How to delete files older than specific date. <dazimi@oradev.csis.csd.metrotor.on.ca>
    Re: How to delete files older than specific date. <rootbeer@teleport.com>
        How to make Python's marshal module available in Perl? skip@calendar.com
    Re: How to make Python's marshal module available in Pe <tchrist@mox.perl.com>
    Re: images in perl <smiles@wfubmc.edu>
    Re: images in perl <rootbeer@teleport.com>
        matlab directed/channelled by perl? <ptrainor@bbn.com>
    Re: Not to start a language war but.. (Snowhare)
    Re: Not to start a language war but.. (I R A Aggie)
    Re: opening illegal filenames (I R A Aggie)
    Re: pass array to sub (Matthew Bafford)
    Re: Pattern matching <rootbeer@teleport.com>
    Re: PERL is TOO flexible <jay@rgrs.com>
        PERL manual - html (John Hardy)
        perlcc and shared libraries <sehughes@mistral.co.uk>
    Re: Problem with encrypting/decrypting files <rootbeer@teleport.com>
    Re: replacing inbetween 2 keywords <rootbeer@teleport.com>
        seperating paragraphs (kind of like $/) rhaig@news.hackboy.com
    Re: seperating paragraphs (kind of like $/) <uri@fastengines.com>
    Re: Setting defaults in @INC? <barnett@houston.Geco-Prakla.slb.com>
    Re: Setting defaults in @INC? <rootbeer@teleport.com>
    Re: system(". $file"); #odd result! <prl2@lehigh.edu>
    Re: Verify secure web page is up <rootbeer@teleport.com>
        warning <jorendorff@ixl.com>
    Re: What is the "correct" location of perl under Solari <mgregory@asc.sps.mot.com>
    Re: What is the "correct" location of perl under Solari <uri@fastengines.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 04 Nov 1998 15:24:44 -0500
From: Uri Guttman <uri@fastengines.com>
Subject: camel races on CNN
Message-Id: <sarzpa7b3zn.fsf@camel.fastserv.com>


last night i was watching cnn headline news and after the sports report
they showed the play of the day. to my surprise it was a camel race in
some country where that is common. it was total chaos and nothing like
the order of a thouroughbred horse race. the camels seem to do what they
wanted to do regardless of their jockey's guidance. seems like our
favorite language has not only the architecture but the personality of
its mascot.

did anyone else catch this? i doubt it will be on again as they use each
POTD clip for only a few broadcasts.

uri

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


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

Date: 4 Nov 1998 19:58:28 GMT
From: ehagen@Hawaii.Edu (Eric Hagen)
Subject: Decimal to Hex conversion
Message-Id: <71qbl4$6a0@news.Hawaii.Edu>


I have found hex () to convert from hex to decimal, and printf to print
out hex values, but for the life of me I can not find in any of my docs on
how to covert decimal values to hex values.  

I'm so desperate I would be happy with a unix tool or system call to get
the hexed value.

Thank you in advance.

--
Eric Hagen                  "Sometimes we get lost in the darkness, 
ehagen@Hawaii.Edu	     the dreamers learn to steer by the stars..."
			    "You fight for something because it is good.
	 				Not because it stands to succeed."


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

Date: 04 Nov 1998 15:07:13 -0500
From: Uri Guttman <uri@fastengines.com>
To: ehagen@Hawaii.Edu (Eric Hagen)
Subject: Re: Decimal to Hex conversion
Message-Id: <sar4ssfcjda.fsf@camel.fastserv.com>

>>>>> "EH" == Eric Hagen <ehagen@Hawaii.Edu> writes:

  EH> I have found hex () to convert from hex to decimal, and printf to
  EH> print out hex values, but for the life of me I can not find in any
  EH> of my docs on how to covert decimal values to hex values.

the solution is in the question! :-)

what are the values you are printing with printf? maybe they are numbers
which were once decimal digit strings? are you getting my hint?

hth,

uri

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


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

Date: 4 Nov 1998 20:45:49 GMT
From: ehagen@Hawaii.Edu (Eric Hagen)
Subject: Re: Decimal to Hex conversion
Message-Id: <71qedt$a0j@news.Hawaii.Edu>

Hate to say no, but I don't.

What I would like to do is to take a number string like 2345678 and then
turn that into the hex value.  Which should be 23CACE.
My understanding of printf is that it allows you to print out the 23CACE,
but not translate it from 2345678 to 23CACE.  Please correct me if I'm
wrong.


Uri Guttman (uri@fastengines.com) wrote:
: >>>>> "EH" == Eric Hagen <ehagen@Hawaii.Edu> writes:

:   EH> I have found hex () to convert from hex to decimal, and printf to
:   EH> print out hex values, but for the life of me I can not find in any
:   EH> of my docs on how to covert decimal values to hex values.

: the solution is in the question! :-)

: what are the values you are printing with printf? maybe they are numbers
: which were once decimal digit strings? are you getting my hint?

: hth,

: uri

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

--
Eric Hagen                  "Sometimes we get lost in the darkness, 
ehagen@Hawaii.Edu	     the dreamers learn to steer by the stars..."
			    "You fight for something because it is good.
	 				Not because it stands to succeed."


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

Date: Wed, 04 Nov 1998 20:02:35 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Difference between netscape and microsoft cgi handling?????
Message-Id: <Pine.GSO.4.02A.9811041201390.7431-100000@user2.teleport.com>

On Wed, 4 Nov 1998, Casema wrote:

> now, when I open this in netscape nav. it does what I hoped.

So, it's not a Perl problem.

> In ie it runs the stupid thing on my computer instead of on the
> server....

When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.

   http://www.perl.com/CPAN/
   http://www.perl.org/CPAN/
   http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
   http://www.perl.org/CPAN/doc/manual/html/pod/

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 04 Nov 1998 19:36:06 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: From Unix to WinNT
Message-Id: <Pine.GSO.4.02A.9811041133120.7431-100000@user2.teleport.com>

On Wed, 4 Nov 1998, Steve miles wrote:

> I've written all of my Perl scripts for the Unix platform, and now I
> have to install some of them on a WinNT server. Am I in for a big
> surprise or will it be easy to move them to the WinNT server. 

Yes, one or the other. :-)

Perhaps the new (in 5.005) manpage on portability issues would help you. 

    http://www.perl.com/CPAN/doc/manual/html/pod/perlport.html

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 04 Nov 1998 18:46:51 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Help please
Message-Id: <Pine.GSO.4.02A.9811041044470.7431-100000@user2.teleport.com>

On Wed, 4 Nov 1998, Idirect wrote:

> Subject: Help please

Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.

    http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post

> I have a *.db file from a program, I need to convert this file to be
> read in access or filemaker. How do I extract the text from it, or
> convert into another extension other than *.db?

You can change the extension with the rename function, but I don't think
that's going to do what you want. :-)

If you're looking for ways to convert files on your system, perhaps the
docs, FAQs, or newsgroups for the applications you're using would be of
help. 

Of course, you may be able to read or write those files with a Perl
program. Perhaps there's a module which will help. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 04 Nov 1998 20:04:29 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Help: Shared memory block as hash of hash
Message-Id: <Pine.GSO.4.02A.9811041203391.7431-100000@user2.teleport.com>

On Wed, 4 Nov 1998, Sanjay Malunjkar wrote:

> In one of my programs, I want to use a shared memory block for
> communication between children and parent processes. I would like to
> use this shared memory block as a hash of hash

You'll probably need to use a tied hash to implement this. Some of the
modules on CPAN may be useful here. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 04 Nov 1998 20:38:15 GMT
From: jhardy@cins.com (John Hardy)
Subject: Re: Help: Shared memory block as hash of hash
Message-Id: <XW202.668$QN1.500633@198.235.216.4>

Try looking here, not sure if this is what you want!

http://www.perl.com/CPAN-local/doc/manual/html/pod/perldsc.html#HASHES_OF_HASHE
S


In article <364098FF.3F4FF333@cisco.com>, smalunjk@cisco.com says...
>
>Hi all,
>
>In one of my programs, I want to use a shared memory block for
>communication between children and parent processes. I would like to use
>this shared memory block as a hash of hash like
>
>('customer' => {'10' => ['msg1',  'msg2', 'msg3'],  '20' =>  ['msg4',
>'msg5']},
> 'public'     => {'778',  => ['msg6']}
>);
>
>How can I do this ?
>
>thanks in advance,
>sanjay
>



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

Date: Wed, 04 Nov 1998 14:46:02 -0500
From: Dariush <dazimi@oradev.csis.csd.metrotor.on.ca>
Subject: How do you delete files in a directory?
Message-Id: <3640AEFA.F5E3AB74@oradev.csis.csd.metrotor.on.ca>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
How can I delete a file in a directory.
<BR>Take for example a file in directory temp:
<BR>&nbsp;</HTML>



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

Date: 4 Nov 1998 20:38:45 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How do you delete files in a directory?
Message-Id: <71qe0l$j0v$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Dariush <dazimi@oradev.csis.csd.metrotor.on.ca> writes:
:How can I delete a file in a directory.

% man perlfunc | gnugrep -C -i delete

--tom
-- 
I might be able to shoehorn a reference count in on top of the numeric
value by disallowing multiple references on scalars with a numeric value,
 but it wouldn't be as clean.  I do occasionally worry about that. --lwall


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

Date: Wed, 04 Nov 1998 20:14:46 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: How does xyz.pl?go=100 links work ?
Message-Id: <Pine.GSO.4.02A.9811041213520.7431-100000@user2.teleport.com>

On 4 Nov 1998, Martin wrote:

> I want to call a perl script without making a input form on the page.

It sounds as if you want your web server to run your CGI programs. The
docs, FAQs, and newsgroups about CGI programming should be able to help
you. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 04 Nov 1998 14:52:16 -0500
From: Dariush <dazimi@oradev.csis.csd.metrotor.on.ca>
Subject: How to capture the result of nslookup
Message-Id: <3640B070.F932FC78@oradev.csis.csd.metrotor.on.ca>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
How do you run the nslookup command from inside the perl and send the results
to a file.
<BR>I know how to send the results from a file to another file but when
I issue the nslookup,&nbsp;<BR>
How do I get the nslookup results to go to a file?
<BR>for example listing of a domain:
<P>c:\nslookup
<BR>> ls metrotor.on.ca
<BR>will give me the records in this domain
<BR>I can do
<BR>> ls metrotor.on.ca > listfile
<P>now listfile contains the result I want
<BR>but how do I do this from inside a perl program?
<P>Thank you
<BR>Please send me an email
<BR>&nbsp;</HTML>



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

Date: Wed, 04 Nov 1998 20:22:35 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: How to capture the result of nslookup
Message-Id: <Pine.GSO.4.02A.9811041222090.7431-100000@user2.teleport.com>

On Wed, 4 Nov 1998, Dariush wrote:

> How do you run the nslookup command from inside the perl and send the
> results to a file.

Try using the Net::DNS module from CPAN instead. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 04 Nov 1998 14:27:57 -0500
From: Azimi <dazimi@oradev.csis.csd.metrotor.on.ca>
Subject: How to delete files older than specific date.
Message-Id: <3640AABD.B077D817@oradev.csis.csd.metrotor.on.ca>


--------------0310AD2E295637702648C433
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit



I like to delete files in a directory older than 10 days.
The following script will list the files older than 10 days but I don't
know how to go about deleting them.
this script will help to keep directories clean
Can anyone help?

     require Cwd;
     #$curdir = Cwd::getcwd();
     print "currnet working directory is = $curdir\n";

     opendir (DIRLIST,"c:\\test") || die ("can not find the files");
     @filelist = readdir (DIRLIST);
     foreach $line(@filelist){
      if (-M $line >10){

       $days_old = -M $line;
       print "$line\n";
       chdir "\\test";
       $newline="c:\\test\\".$line;
       exec "del", $newline;

      }
     }

     Thank you.
     Dariush.
Please send me in an email
dazimi@oradev.csis.csd.metrotor.on.ca

--------------0310AD2E295637702648C433
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<FONT FACE="Courier New,Courier"></FONT>&nbsp;<FONT FACE="Courier New,Courier"></FONT>
<P><FONT FACE="Courier New,Courier">I like to delete files in a directory
older than 10 days.</FONT>
<BR><FONT FACE="Courier New,Courier">The following script will list the
files older than 10 days but I don't know how to go about deleting them.</FONT>
<BR><FONT FACE="Courier New,Courier">this script will help to keep directories
clean</FONT>
<BR><FONT FACE="Courier New,Courier">Can anyone help?</FONT><FONT FACE="Courier New,Courier"></FONT>
<P><FONT FACE="Courier New,Courier">&nbsp;&nbsp;&nbsp;&nbsp; require Cwd;</FONT>
<BR><FONT FACE="Courier New,Courier">&nbsp;&nbsp;&nbsp;&nbsp; #$curdir
= Cwd::getcwd();</FONT>
<BR><FONT FACE="Courier New,Courier">&nbsp;&nbsp;&nbsp;&nbsp; print "currnet
working directory is = $curdir\n";</FONT><FONT FACE="Courier New,Courier"></FONT>
<P><FONT FACE="Courier New,Courier">&nbsp;&nbsp;&nbsp;&nbsp; opendir (DIRLIST,"c:\\test")
|| die ("can not find the files");</FONT>
<BR><FONT FACE="Courier New,Courier">&nbsp;&nbsp;&nbsp;&nbsp; @filelist
= readdir (DIRLIST);</FONT>
<BR><FONT FACE="Courier New,Courier">&nbsp;&nbsp;&nbsp;&nbsp; foreach $line(@filelist){</FONT>
<BR><FONT FACE="Courier New,Courier">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if
(-M $line >10){</FONT>
<BR><FONT FACE="Courier New,Courier">&nbsp;</FONT>
<BR><FONT FACE="Courier New,Courier">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$days_old = -M $line;</FONT>
<BR><FONT FACE="Courier New,Courier">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
print "$line\n";</FONT>
<BR><FONT FACE="Courier New,Courier">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
chdir "\\test";</FONT>
<BR><FONT FACE="Courier New,Courier">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$newline="c:\\test\\".$line;</FONT>
<BR><FONT FACE="Courier New,Courier">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
exec "del", $newline;</FONT>
<BR><FONT FACE="Courier New,Courier">&nbsp;</FONT>
<BR><FONT FACE="Courier New,Courier">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT>
<BR><FONT FACE="Courier New,Courier">&nbsp;&nbsp;&nbsp;&nbsp; }</FONT><FONT FACE="Courier New,Courier"></FONT>
<P><FONT FACE="Courier New,Courier">&nbsp;&nbsp;&nbsp;&nbsp; Thank you.</FONT>
<BR><FONT FACE="Courier New,Courier">&nbsp;&nbsp;&nbsp;&nbsp; Dariush.</FONT>
<BR><FONT FACE="Courier New,Courier">Please send me in an email</FONT>
<BR><FONT FACE="Courier New,Courier">dazimi@oradev.csis.csd.metrotor.on.ca</FONT></HTML>

--------------0310AD2E295637702648C433--



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

Date: Wed, 04 Nov 1998 20:19:56 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: How to delete files older than specific date.
Message-Id: <Pine.GSO.4.02A.9811041218300.7431-100000@user2.teleport.com>

On Wed, 4 Nov 1998, Azimi wrote:

> Newsgroups: comp.lang.perl.misc, comp.lang.perl.modules

What does this have to do with modules?

> The following script will list the files older than 10 days but I
> don't know how to go about deleting them.

There's a function documented in the perlfunc manpage. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 04 Nov 1998 20:18:22 GMT
From: skip@calendar.com
Subject: How to make Python's marshal module available in Perl?
Message-Id: <71qcqe$nn1$1@nnrp1.dejanews.com>

I would like to make the functionality of Python's marshal module availble in
Perl.  The most straightforward way (to me) would be to modify the existing
marshal.c file to marshal and unmarshal the desired objects.  Short-term I
only need the basics: lists, tuples, strings, ints, floats and dictionaries.
That stuff should all map between Python and Perl fairly well (equating
tuples and lists for the time being, and assuming dictionaries only have
strings as keys). I'm going to ignore more advanced functionality for now
(perhaps indefinitely).

So far I have yet to find a C-callable API for Perl that will allow me to
attempt a straightforward conversion of the C code.  I did find PerlXS, but
its use in this situation seems a bit unobvious to me.	Marshal is, after
all, not a simple C subroutine library like curses.

Any suggestions about how best to proceed would be appreciated.

--
Skip Montanaro
Mojam: Uniting the world of music: http://www.mojam.com/

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


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

Date: 4 Nov 1998 20:36:36 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to make Python's marshal module available in Perl?
Message-Id: <71qdsk$j0v$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    skip@calendar.com writes:
:I would like to make the functionality of Python's marshal module availble in
:Perl.  The most straightforward way (to me) would be to modify the existing
:marshal.c file to marshal and unmarshal the desired objects.  

Check out the Storable, FreezeThaw, or Data::Dumper modules from CPAN.

--tom
-- 
"L'extension des privileges des femmes est le principe general de tous
 progres sociaux."
    --Charles Fourier, 1808


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

Date: Wed, 04 Nov 1998 13:26:55 -0500
From: Steve miles <smiles@wfubmc.edu>
Subject: Re: images in perl
Message-Id: <36409C6F.DF1B8EB3@wfubmc.edu>

Try it without the quotes...
Steve

Operator wrote:

> I have a perl cgi that outputs html, but when I put image html code (<img
> src="..."> I get server 500 error. Is there a special way to do this?



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

Date: Wed, 04 Nov 1998 19:07:27 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: images in perl
Message-Id: <Pine.GSO.4.02A.9811041106570.7431-100000@user2.teleport.com>

On 2 Nov 1998, Operator wrote:

> I get server 500 error.

When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.

   http://www.perl.com/CPAN/
   http://www.perl.org/CPAN/
   http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
   http://www.perl.org/CPAN/doc/manual/html/pod/

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/




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

Date: Wed, 4 Nov 1998 15:58:31 -0500
From: Pat Trainor <ptrainor@bbn.com>
Subject: matlab directed/channelled by perl?
Message-Id: <Pine.LNX.3.96.981104155727.4391C-100000@aura>


        Anyone know how I can use/direct matlab from perl to return a jpg
stream, vs. making a file? 

like:

load jbdata          % columnated data
x=jbdata(:,1);       % first column is "x"
n=size(jbdata,2);    % number of columns
y=jbdata(:,[2:n]);   % other columns are "y" sets
plot(x,y)            % plot the data
print -djpeg         % print to jpg file (figure1.jpg)
   
tia!
   
pat 	
:)




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

Date: 4 Nov 1998 19:06:12 GMT
From: snowhare@devilbunnies.org (Snowhare)
Subject: Re: Not to start a language war but..
Message-Id: <71q8j4$a3o$1@nnrp2.snfc21.pbi.net>



Nothing above this line is part of the signed message.

In article <3640829A.30854642@min.net>, John Porter  <jdporter@min.net> wrote:
>Thomas Andrews wrote:
>> 
>> In article <363f183a.9460846@read.news.global.net.uk>,
>> >
>> >Exactly what I've been saying - perl discourages OO programming.
>> 
>> I essentially agree with this.
>
>I hope by now everyone can see that this is not really a valid
>characterization of Perl.  For some people, apparently, it is
>valid to say that they find attemping OO in Perl leaves them
>discouraged; but many other people do not share that experience.
>I, for example, find programming OO in Perl to be no more
>trouble than non-OO.

I would go beyond that. I prefer OO in Perl to non-OO in Perl. At a
critical junture in writing a project I realized that my _normal_
way of programming was identical to Perl's OO methods (in fact,
so much so that converting the project to OO was _literally_ a matter
of blessing an anonymous hash reference and changing the calls 
to OO style - the target methods simply worked. I was already passing 
the reference as the first parm). By switching to OO Perl I 
extended the power of my normal style by a quantum step. I haven't 
looked back.

Benjamin Franz


Version: 2.6.2

iQCVAwUBNkCldujpikN3V52xAQHq5gQAgrR2MnUBG7SAQJFH1XKJbL7fnw8ML8Wd
9lQfsbELlNqfjKUWx7e+chZRHn1wLwWtlpGLzYCFnEXT8JifyOuw9wADRMxaWzGH
Q9GqGOLosdAabarrIaeabtbKX/4GXqqA5g6jLlliqSiguf920vz/E2qBB4XasEaP
quax67u8TaU=
=OxpS
-----END PGP SIGNATURE-----


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

Date: Wed, 04 Nov 1998 13:44:33 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Not to start a language war but..
Message-Id: <fl_aggie-0411981344330001@aggie.coaps.fsu.edu>

In article <36409360.82944639@bigfoot.com>, Hoon Yoon <hyoon@bigfoot.com> wrote:

+ How do I get rid of this thread only from Netscape Discussion?

You get a better newsreader. Think "killfiles".

James - and netscrape ain't it...


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

Date: Wed, 04 Nov 1998 13:41:31 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: opening illegal filenames
Message-Id: <fl_aggie-0411981341310001@aggie.coaps.fsu.edu>

In article <364090fb.0@d032>, "Phil Harris" <harrisp2@cf.ac.uk> wrote:

+ the only way to consistently cope with the crappy mac filenames 

YM 'crappy dos filesystem'. HTH.

James


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

Date: Wed, 4 Nov 1998 13:40:23 -0500
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: pass array to sub
Message-Id: <MPG.10aa699fe3ad56079896fb@news.scescape.net>

In article <<8cg1c6qce4.fsf@gadget.cscaper.com>>, 
merlyn@stonehenge.com (Randal Schwartz) pounded the following:
=> Don't mess with globals, unless you narrow the damage.  Important
=> Maintenance Rule #6.

And the others are?

--Matthew
Who is honestly curious, not trying to be a pain.


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

Date: Wed, 04 Nov 1998 19:56:13 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Pattern matching
Message-Id: <Pine.GSO.4.02A.9811041152250.7431-100000@user2.teleport.com>

On Wed, 4 Nov 1998 alan@ciborg.demon.co.uk wrote:

> Subject: Pattern matching

Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.

    http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post

> I am trying to split a .csv file 

See the FAQ, section four. Also, check out the Text::CSV module on CPAN.
Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 04 Nov 1998 14:07:14 -0500
From: Jay Rogers <jay@rgrs.com>
Subject: Re: PERL is TOO flexible
Message-Id: <82k91b1dlp.fsf@shell2.shore.net>

Brent Michalski <perlguy@technologist.com> writes:

>  In article <3638676E.F980FC4A@harris.com>,
>  PERL ROCKS! <emills@harris.com> wrote:
>  > "Although the Perl Slogan is There's More Than One Way to Do It, I
>  > hesitate to make 10 ways to do something. :-) "
>  >     --Larry Wall in <9695@jpl-devvax.JPL.NASA.GOV>
>  >
>  >is along these lines- why make more than ONE? What did it add, Larry?
> 
> Wow, I *HAD* to comment on this "ONE" (pun intended)
> 
> Why on earth would you want only ONE way to do something in a
> language?!??!

Maintainability.

Unfortunately, because of Perl's expressive power, code that may seem
elegant to an implementor, can look like serial line noise to you the
maintainer.  This is why one Unix luminary has called Perl a
write-only language.

We as programmers don't tend to think about maintainability, perhaps
because it's boring and we'd prefer someone else did it.  But it's not
unusual for a project to require more effort for maintenance than was
necessary for implementation.

In what ways can we as Perl programmers make our code more
maintainable?  Always 'use strict' and follow 'man perlstyle'.

--
Jay Rogers
jay@rgrs.com


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

Date: Wed, 04 Nov 1998 20:46:34 GMT
From: jhardy@cins.com (John Hardy)
Subject: PERL manual - html
Message-Id: <K2302.673$QN1.500633@198.235.216.4>



http://www.perl.com/CPAN-local/doc/manual/html/pod/perltoc.html


is there a place that you can "keyword search" through the above HTML document?


John 
 



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

Date: Wed, 04 Nov 1998 20:45:50 +0000
From: Stuart Hughes <sehughes@mistral.co.uk>
Subject: perlcc and shared libraries
Message-Id: <3640BCFE.62CB82D8@mistral.co.uk>

Hi all,

In the perldoc for perlcc, I see:

%prompt  perlcc A.pm       # compile into 'A.so'

and sure enough, I can generate .so's from .pm's.  My question is, how
can I later make use of these shared libraries ???

TIA

Stuart Hughes

using 5.005_51 built for i586-linux


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

Date: Wed, 04 Nov 1998 19:06:11 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Problem with encrypting/decrypting files
Message-Id: <Pine.GSO.4.02A.9811041104190.7431-100000@user2.teleport.com>

On Wed, 4 Nov 1998 glerat@igtech.fr wrote:

> while (read FICHIER, $buffer, 8)  {
>         my $in = pack("H16", $buffer);

I think you want unpack here, to turn eight bytes into 16 hex characters.
Right? There may be other errors in your code; I only gave it a quick
look. Stepping through it with the debugger can help you to catch things
like this. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 04 Nov 1998 19:45:12 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: replacing inbetween 2 keywords
Message-Id: <Pine.GSO.4.02A.9811041139540.7431-100000@user2.teleport.com>

On Wed, 4 Nov 1998, mikej wrote:

> Now is there a way to open an html file, then find a piece of text
> between 2 keywords and replace or delete it?

Of course! If Perl couldn't do a simple thing like that, it wouldn't be
very capable, would it?

> If I wanted to replace or delete everything in my html file inbetween
> where it says <!--START--> and <!STOP-->, is that possible with perl?

Yes, certainly! That's not at all difficult with Perl.

> Normally I could just do a substitute command and tell it exactly
> which text to replace, but the problem is that since the content of
> the html file is now generated dynamically, I dont know exactly what
> the content is, so I cant specify what to replace. Any ideas?

So, you don't know how to specify what it is that you want to find and
replace? Alas, this problem is beyond the capabilities of Perl. Current
versions can't determine what it is that you need done, except in very
limited cases. Maybe when Perl 17 introduces the DWIM operator, but not
yet. If you ever find out how to identify the text you want to find and
replace, though, you could use the HTML::Parser module from CPAN to make
the rest of your task easy. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 4 Nov 1998 12:05:23 -0600
From: rhaig@news.hackboy.com
Subject: seperating paragraphs (kind of like $/)
Message-Id: <71q513$87s$1@cartman.hackboy.com>

ok, here is the format of the input I'll be dealing with:
================
user1:
attr1=val1
attr2=val2
attr3=val3
user2:
attr1=val1
attr2=val2
attr3=val3
================
so they're not really paragraphs.  If I set $/ to "\w+:", then I get 3 input
records from the above input:
=============
user1:
===========
attr1=val1
attr2=val2
attr3=val3
user2:
===========
attr1=val1
attr2=val2
attr3=val3
================
what I really want is 2 records with the user at the top of each set
of attributes (yes, I'm dealing with AIX if you haven't guessed it by now)

I can't expect the input to have 2 \n between records, although that can happen

I can't expect one specific attribute to be last on the list (I wish).
I'd rather not massage the input too much if possible.

any ideas?
(rtfm is acceptable, if you point me to the right section of the fm)

thanks
-- 
Rob


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

Date: 04 Nov 1998 13:30:07 -0500
From: Uri Guttman <uri@fastengines.com>
Subject: Re: seperating paragraphs (kind of like $/)
Message-Id: <sarbtmncnv4.fsf@camel.fastserv.com>

>>>>> "r" == rhaig  <rhaig@news.hackboy.com> writes:

  r> ok, here is the format of the input I'll be dealing with:
  r> ================
  r> user1:
  r> attr1=val1
  r> attr2=val2
  r> attr3=val3
  r> user2:
  r> attr1=val1
  r> attr2=val2
  r> attr3=val3
  r> ================


  r> so they're not really paragraphs.  If I set $/ to "\w+:", then I
  r> get 3 input records from the above input:

this is because $/ is the END of the record marker. so user1: is the end
of the first blank record. so you can't do this easily with $/

  r> =============
  r> user1:
  r> ===========
  r> attr1=val1
  r> attr2=val2
  r> attr3=val3
  r> user2:
  r> ===========
  r> attr1=val1
  r> attr2=val2
  r> attr3=val3
  r> ================

  r> what I really want is 2 records with the user at the top of each
  r> set of attributes (yes, I'm dealing with AIX if you haven't guessed
  r> it by now)

  r> I can't expect the input to have 2 \n between records, although
  r> that can happen

  r> I can't expect one specific attribute to be last on the list (I wish).
  r> I'd rather not massage the input too much if possible.

if the file is not too big, read it in one chunk and split it with a
regex or split on user\d+.

to read it in one chunk:

{ local $/;
  $user_file = <> 	# or use your file handle
}

@users = split( /(?=^user\d+)/m, $user_file )

hth,

uri

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


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

Date: Wed, 04 Nov 1998 13:45:41 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: Setting defaults in @INC?
Message-Id: <3640AEE5.CAADDA4F@houston.Geco-Prakla.slb.com>

Ryan Grace wrote:
> 
> Hi All.  Our University Telecomm people just upgraded to Perl 5.005 on our
> web server and it went less than smoothly.  Many modules are not found in
> the paths in @INC anymore.  My understanding is that @INC includes the
> site_perl directory, but after our upgrade it does not.  I've tried
> push(@INC, '/usr/local/lib/perl5/site_perl'); to no avail in my scripts.
> I'd like to be able to tell them how to permanently add the site_perl path
> to the @INC array.  They don't know how it's done.  Anyone know where these
> values are stored?  Is there a config file I can modify somewhere or is
> that too easy?
> 
> Ryan Grace
> Office for Enrollment Management
> Humboldt State University
I just recently installed perl5.005_02 in my home directory under
~/perl.  Under ~/perl, there are lib/site_perl and lib/5.00502, as
expected.

It would appear that something was answered incorrectly during the
configuration process.

Perhaps perl -e 'print join("\n",@INC),"\n"' will provide some insight
on what directories are being searched.

I get the following output:
perl -e 'print join("\n",@INC),"\n"'
/home/seismos/lib/perl
/auto/dapdserv_dsk4/barnett/perl/lib/5.00502/sun4-solaris
/auto/dapdserv_dsk4/barnett/perl/lib/5.00502
/auto/dapdserv_dsk4/barnett/perl/lib/site_perl/5.005/sun4-solaris
/auto/dapdserv_dsk4/barnett/perl/lib/site_perl/5.005
 .


Perl -v shows me the following:

perl -v
 
This is perl, version 5.005_02 built for sun4-solaris
 
Copyright 1987-1998, Larry Wall
 
Perl may be copied only under the terms of either the Artistic License
or the
GNU General Public License, which may be found in the Perl 5.0 source
kit.
 
Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'.  If you have access to
the
Internet, point your browser at http://www.perl.com/, the Perl Home
Page.



As an aside, you are aware that due to changes from 5.004 to 5.005, you
will might need to rebuild some of your modules, right?  Check the
README, etc. files for details.

HTH.

Dave

-- 
Dave Barnett	Software Support Engineer	(281) 596-1434


I always wanted to be a procrastinator, never got around to it.


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

Date: Wed, 04 Nov 1998 20:10:50 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Setting defaults in @INC?
Message-Id: <Pine.GSO.4.02A.9811041205540.7431-100000@user2.teleport.com>

On 4 Nov 1998, Ryan Grace wrote:

> Our University Telecomm people just upgraded to Perl 5.005 on our web
> server and it went less than smoothly.  Many modules are not found in
> the paths in @INC anymore.  

Complain to whoever (mis-)configured it; it should have been configured to
include whatever paths you used to have, unless omitting some was
intentional.

> My understanding is that @INC includes the site_perl directory, but
> after our upgrade it does not. 

Depends upon the configuration, of course.

> I've tried push(@INC, '/usr/local/lib/perl5/site_perl'); to no avail
> in my scripts.

I imagine that you've forgotten that 'use' is a compile-time directive.
Consider 'use lib' instead of that push. But a properly-configured perl is
the real solution, almost certainly.

> I'd like to be able to tell them how to permanently add the site_perl
> path to the @INC array.  They don't know how it's done.

Details are in the installation instructions which come with the perl
source. It's not hard. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 4 Nov 1998 13:14:06 -0500
From: "Phil R Lawrence" <prl2@lehigh.edu>
Subject: Re: system(". $file"); #odd result!
Message-Id: <71q5k0$sd2@fidoii.cc.Lehigh.EDU>

>set_env_vars:
>===========================
>#!/bin/ksh
>export ADMIN_SYS_LIST=joe@machine1,dink!@lehigh.edu,prl2@lehigh.edu
>export ADMIN1_MAIL_LIST=fine@admin1,bink@admin1
><snip>
>===========================

>my $x = system(". $file");


>I get:
>prompt >test.pl
>sh: ADMIN_SYS_LIST=joe@machine1,dink!@lehigh.edu,prl2@lehigh.edu: 0402-026 The
>specified data is not a valid identifier.


SOLUTION:  First and foremost, sh doesn't understand export.

Phil R Lawrence





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

Date: Wed, 04 Nov 1998 19:06:50 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Verify secure web page is up
Message-Id: <Pine.GSO.4.02A.9811041106280.7431-100000@user2.teleport.com>

On Wed, 4 Nov 1998, Ed Young wrote:

> Does anyone have any examples of perl code that verify a web page that
> is secure? I imagine using something with module LWP, I have to
> authenticate with a username and password and check the page is still
> available, any suggestions are appreciated.

Have you seen the docs which come with LWP? Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 04 Nov 1998 13:14:18 -0800
From: Jason Orendorff <jorendorff@ixl.com>
Subject: warning
Message-Id: <3640C3AA.A1A16ADD@ixl.com>

> Except of course that warn does not have to output to stderr...
> 
> $SIG{__WARN__} can do whatever it likes with it (useful in things such
> as CGI (though you should just use CGI.pm)).

This is a trivial consideration compared to the serious differences
between exception handling and religiously checking return values.

I admit Perl's warn() isn't bad, though, and when Python gets something
similar, I'll probably use it from time to time.  (C:

> This leaves the caller free to handle the warning however it wants.

In both Perl and Python you're free to handle the error however you
like.  What you're talking about isn't a PL design issue so much as a
quirk of the standard library.

-- 
Jason


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

Date: 04 Nov 1998 13:29:32 +1030
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: Re: What is the "correct" location of perl under Solaris?
Message-Id: <r8af286u3v.fsf@asc.sps.mot.com>

Tk Soh <r28629@email.sps.mot.com> writes:

> Martin Gregory wrote:
> > 
> > Tk Soh <r28629@email.sps.mot.com> writes:
> > > I wonder why we couldn't just let the #! look for Perl by just PATH variable.
> > >
> > > -tk
> > 
> > We do.  We use this at the top of perl scripts...
> > 
> > eval 'exec perl -w -S $0 ${1+"$@"}'     # Use the  -*- perl -*- on our path
> >      if 0;
> > 
> > .. no more #! problems...
> 
> Wow, this is great! Mind explain to me how it work? Thanks.

Basically, two things can happen to your script.  Either it is passed
to perl:

  perl my_script args

or it is executable, so it is invoked directly:

  my_script args

In the first case, obviouly the perl on the path is used.  This perl
reads the file and finds

  eval 'something' if 0;

as the first 'command'.  0 is not true, so it does nothing with this
and goes on to the rest of the script.  Good.

In the second case, your shell passes the file to the UNIX kernel for
execution.  It finds that there is no #! line, and it's not any other
sort of directly executable object, so it invokes /bin/sh to parse it
(see exec(2)).

Here is where a trick is.  /bin/sh commands end on a newline, so it sees

  eval 'exec perl -w -S $0 ${1+"$@"}'

So - the shell fires up the perl on the path, with the -w option and
the -S option plus all the options that were passed to the original
shell script.

(That is what the $0 ${1+"$@"} blah is about - that kind of blah is
 required to stop things like single arguments with spaces embedded in
 them from getting broken up (* but see below).)

-w needs no explanation

-S helps perl find the script on systems where $0 doesn't have the
   full path to the script.

So now the script is running under the perl on your path, which then
ignores the  

  eval 'something' if 0;

as described above, and you are in business!

* it has been argued that this expression is overkill - that $@ is
  sufficient.  We leave it as ${1+"$@"} because we know it works in
  all the cases we've tried, wheras a simplified version might not!

Hope this helps.

Martin.

(By The Way, how do I get this question, answer & explanation into the FAQ?)


----------------------------------------------------------------------
-- Martin Gregory <mgregory@asc.sps.mot.com>          |    _--_|\ 
-- Program Manager, Modelling & Cosimulation Program  |   / MASC \ 
-- Motorola Australia Software Centre                 |   \_.-*._/
-- Phone: +61 8 8203 3612, Fax: +61 8 8203 3501       |         v
----------------------------------------------------------------------


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

Date: 04 Nov 1998 14:56:13 -0500
From: Uri Guttman <uri@fastengines.com>
To: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: Re: What is the "correct" location of perl under Solaris?
Message-Id: <sar90hrcjvm.fsf@camel.fastserv.com>

>>>>> "MG" == Martin Gregory <mgregory@asc.sps.mot.com> writes:

<snip of good explanation of #! trick>


  MG> (By The Way, how do I get this question, answer & explanation into
  MG> the FAQ?)

send it to gnat@frii.com who maintains it. i think it should be in there
too.

uri


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


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

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

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