[16013] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3428 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 20 11:19:05 2000

Date: Tue, 20 Jun 2000 03:10:20 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <961495820-v9-i3428@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 20 Jun 2000     Volume: 9 Number: 3428

Today's topics:
    Re: Perl and the WSH <gellyfish@gellyfish.com>
    Re: Perl code for unzip <gellyfish@gellyfish.com>
    Re: Perl DBI Oracle? <gellyfish@gellyfish.com>
    Re: perl generated html response problem <gellyfish@gellyfish.com>
    Re: perlservices.com <robert@pharmapartners.nl>
    Re: perlservices.com <gellyfish@gellyfish.com>
    Re: Redefinition of union Semun <gellyfish@gellyfish.com>
    Re: reg expression question <gellyfish@gellyfish.com>
    Re: Reg Expression Question <mike.solomon@eps.ltd.uk>
    Re: Reg Expression Question <chris@inta.net.uk>
        sbin commands from cgi-bin perl wmcn@my-deja.com
    Re: simple array question <ils@gil.com.au>
    Re: simple array question <ils@gil.com.au>
    Re: simplest e-mail script in the world wanted <gellyfish@gellyfish.com>
    Re: simplest e-mail script in the world wanted nobull@mail.com
    Re: Sorting a ':' delimeted file by a field value/surna (Bart Lateur)
    Re: SSL session variable <gellyfish@gellyfish.com>
    Re: Unix database for Perl <gellyfish@gellyfish.com>
    Re: URL Redirection <gellyfish@gellyfish.com>
    Re: Use of split and join with special character <gellyfish@gellyfish.com>
    Re: What the... <gellyfish@gellyfish.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 18 Jun 2000 14:18:08 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl and the WSH
Message-Id: <8iii6g$nh3$1@orpheus.gellyfish.com>

On Sat, 17 Jun 2000 03:23:03 +0200 Jan van Mansum wrote:
> Jan van Mansum schreef:
> 
>> Hello all,
>>
>> I am writing scripts for the Windows Script Host and I take it you can
>> also use Perl instead of VBScript or JScript. However, how do you work
>> with the objects that provide basic in- output facilities? (I tried to
>> call WScript.Echo but that doesn't work.)
>>
>> I am using ActivePerl.
>>
>> Thanks for any help.
>>
>> Regards,
>>
>> Jan van Mansum.
> 
> Never mind, examples and answers on the net:
> 
> http://pages.infinit.net/che/perlwsh/perlwsh0.html
> 
> http://cwashington.netreach.net/script_repository/
> 

There are also examples included in the latest Activeperl release.

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


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

Date: 18 Jun 2000 13:03:33 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl code for unzip
Message-Id: <8iidql$9r6$1@orpheus.gellyfish.com>

On Sat, 17 Jun 2000 15:01:42 -0500 Randy Kobes wrote:
> 
> Luc-Etienne Brachotte <Luc-Etienne.Brachotte@wanadoo.fr>
>     wrote in message news:394BD7C8.66AE4F49@wanadoo.fr...
> 
>> I'm looking for Perl code/module for unziping (also for zipping) files,
>> mainly to a Perl scalar variable. unzipping to a file will also do.
> 
> Sounds like you want the Archive::Zip module - see, for example,
> http://theoryx5.uwinnipeg.ca/CPAN/data/Archive-Zip/Archive/Zip.html
> for documentation on its use and how to get it.
> 

Or indeed Compress::Zlib ...

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


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

Date: Tue, 20 Jun 2000 09:23:13 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl DBI Oracle?
Message-Id: <5KG35.371$My4.38272@news.dircon.co.uk>

On Mon, 19 Jun 2000 21:21:08 -0700, Robert Wrote:
>     Is perl the preferred method for pulling data out of an oracle
> database into text files?  

Dont know about Oracle but with Informix it is *my* preferred method - even
over I4GL or esql/c - where the 'text' files might be CSV, HTML, troff or
plaintext reports ...

>                            Can resident "bot" programs be written in
> perl for unix that would generate files on a schedule?  

Yes.

>                                                        Perl is
> generally available on unix boxes installed with the OS?

If it isnt already on your machine it is simply compiled.

> 
> Sorry for the general questions.  I'm a VB-Database programmer 

My heart goes out to you.

>                                                                 and I'm
> going to have to do some database work on a unix machine and I'm trying
> to figure out the best way to do it.
> 

Of course you could use VB with ODBC from a windows machine if you had to
or you can use PL/SQL to do rudimentary stuff.  You might want to ask in
comp.databases.oracle to get a feel for what other people prefer.

>     Is the Perl DBI O-riley book the only one available that would cover
> databasing with perl?
> 

Its the recommended one for sure.


/J\


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

Date: 18 Jun 2000 12:23:46 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: perl generated html response problem
Message-Id: <8iibg2$1tu$1@orpheus.gellyfish.com>

On Sat, 17 Jun 2000 12:53:10 +0200 Markus Hediger wrote:
>> CGI Error
>> The specified CGI application misbehaved by not returning a complete
>> set of HTTP headers. The headers it did return are:
> 
> all these lazy guys told you to look at cgi docs - but actually the
> answer is that easy. 

Huh ?  Lauren said ask in comp.infosystems.www.authoring.cgi and Abigail
suggested reading the CGI specification.

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


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

Date: Tue, 20 Jun 2000 11:26:30 +0200
From: "Robert Voesten" <robert@pharmapartners.nl>
Subject: Re: perlservices.com
Message-Id: <8indc8$b0h$1@porthos.nl.uu.net>


"Please don't SPAM me" <NoSPAM@NoSPAM.net> schreef in bericht
news:394bd645$0$94748$726baab@news.execpc.com...
> Just wondering if there would be any interest in anyone buying the domain
> perlservices.com from me.
>
> PRACTICE WHAT YOU PREACH




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

Date: 18 Jun 2000 13:18:24 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: perlservices.com
Message-Id: <8iiemg$cmh$1@orpheus.gellyfish.com>

On Sat, 17 Jun 2000 14:48:36 -0500 Please don't SPAM me wrote:
> Just wondering if there would be any interest in anyone buying the domain
> perlservices.com from me.
> 

I'm sure that there would be a lot of interest if you were to *donate* the
domain to the Perl Community.  Other than that I would say that this is a
case of domain carpet-bagging ...

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


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

Date: 20 Jun 2000 08:25:39 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Redefinition of union Semun
Message-Id: <8in69j$79a$1@orpheus.gellyfish.com>

On Mon, 19 Jun 2000 04:21:17 GMT Gordon Hooton wrote:
> I am trying to install PerlMagick on a Linux sytem. When "making" I get
> an error in perl.h (line 2546) stating "redefinition of union senum"
> I see this is caused by an "#   ifndef HAS_UNION_SEMUN" construct.
> The perl is version 5.00503
> 
> Has anyone any suggestions.
> 

#define HAS_UNION_SEMUN ?

This is probably because the ImageMagick includes define it as well.

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


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

Date: 19 Jun 2000 23:52:25 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: reg expression question
Message-Id: <8im879$fc$1@orpheus.gellyfish.com>

On Mon, 19 Jun 2000 11:39:13 -0400 Drew Simonis wrote:
> Jang Choe wrote:
>> 
>> How do I determine that a string can be composed of any character on
>> the key board, such as !,@,#,$,%,etc.,  Thanks
> 
>  Organization: Georgia Institute of Technology
> 
> As a former student of this fine University, I am thunderstruck by 
> the lack of even an attempt to solve this porblem on your own.  
> 
>  § ~ ? ä ² F µ ±  <--  Look what I found on my keyboard!
> 
> Point here is, show what you want to accomplish, and how
> you have tried to accomplish it, and people will help.
> 
> Your question is far too vague.  ¦ <- found that too.

¬ - I always liked that one. 

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


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

Date: Tue, 20 Jun 2000 10:25:07 +0100
From: "mike solomon" <mike.solomon@eps.ltd.uk>
Subject: Re: Reg Expression Question
Message-Id: <8indap$5733c$1@fu-berlin.de>

I would use

$MyString='<img src="http://www.myhouse.com.au/house.gif">';
$MyString =~ s-^.*/|[">"]--g;

this is fairly flexible as it strips up to the last / and strips "> from end

Regards

Mike Solomon



<tony_123@my-deja.com> wrote in message news:8imldk$f61$1@nnrp1.deja.com...
> Hi Folks
>
> I have the string
>
> $MyString='<img src="http://www.myhouse.com.au/house.gif">';
>
> Can someone please tell me how I can extract the house.gif part of this
> string.
>
> Cheers
>
> Tony
>
>
>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.




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

Date: Tue, 20 Jun 2000 10:52:08 +0100
From: "Chris Denman" <chris@inta.net.uk>
Subject: Re: Reg Expression Question
Message-Id: <8inesh$f57$1@news2.vas-net.net>

#!/perl/bin/perl

$string='<img src="http://www.myhouse.com.au/house.gif">';

$last=(split(/\//,$string))[-1];
$last=~s/\"\>//;

print "$last\n";


hth


mike solomon wrote in message <8indap$5733c$1@fu-berlin.de>...
>I would use
>
>$MyString='<img src="http://www.myhouse.com.au/house.gif">';
>$MyString =~ s-^.*/|[">"]--g;
>
>this is fairly flexible as it strips up to the last / and strips "> from
end
>
>Regards
>
>Mike Solomon
>
>
>
><tony_123@my-deja.com> wrote in message news:8imldk$f61$1@nnrp1.deja.com...
>> Hi Folks
>>
>> I have the string
>>
>> $MyString='<img src="http://www.myhouse.com.au/house.gif">';
>>
>> Can someone please tell me how I can extract the house.gif part of this
>> string.
>>
>> Cheers
>>
>> Tony
>>
>>
>>
>>
>>
>> Sent via Deja.com http://www.deja.com/
>> Before you buy.
>
>




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

Date: Tue, 20 Jun 2000 08:37:20 GMT
From: wmcn@my-deja.com
Subject: sbin commands from cgi-bin perl
Message-Id: <8inag0$s8v$1@nnrp1.deja.com>

Hi,

 how is it possible to run a /sbin/ command through a perl cgi-script.

basically, I'm aiming to modify IP address in debian linux
via supplying form ip of ip, subnet, broadcast addy.
I cannot seem to execute the command, but can get the basic
no arg output of the /sbin/ifconfig into a page no problem.

I've thought of changing the mod to 6555 but it didn't work,
even when using a shell script as shown below...

I guess I'm referencing text rather than command..

I've got something silly like to following:
Note the contents{'ipaddy'} returns correct ip address.

sub setthem {

$ifc="/home/www/ifconf.sh";

@okay ="/home/www/cgi-bin/ifconf.sh eth0 $contents{'ipaddy'}
$contents{'netmask'} $contents{'brcast'}";

if ( -x $ifc ) {
  print "command: @okay";
  @okay;
  print "<H2>saved</H2></font>\n";
 }
 else {
  print "command: @okay";
  @okay;
  print "<H2>error</H2></font>\n";
  }
 }


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 20 Jun 2000 15:17:10 +1000
From: "Phil Sutcliffe" <ils@gil.com.au>
Subject: Re: simple array question
Message-Id: <394f027a_1@news.bne.gil.com.au>

"Tad McClellan" <tadmc@metronet.com> wrote in message
news:slrn8kr4lc.d0s.tadmc@magna.metronet.com...
> On Mon, 19 Jun 2000 11:07:24 +1000, Phil Sutcliffe <ils@gil.com.au> wrote:

> Friends don't let friends use symrefs.

You have made it blatently obvious that you are no friend of mine, so why
can't I use them!






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

Date: Tue, 20 Jun 2000 15:19:19 +1000
From: "Phil Sutcliffe" <ils@gil.com.au>
Subject: Re: simple array question
Message-Id: <394f027a$1_1@news.bne.gil.com.au>


"jason" <elephant@squirrelgroup.com> wrote in message
news:MPG.13b8c102eea31a9e989748@news...

> it was stealth emailed too *8^(


A simple mistake. I apologise.




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

Date: Tue, 20 Jun 2000 09:07:46 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: simplest e-mail script in the world wanted
Message-Id: <CvG35.369$My4.38272@news.dircon.co.uk>

On Tue, 20 Jun 2000 05:26:23 GMT, Kirk Sansom Wrote:
> I am a totally programming novice and urgently need a simple
> script to send a prewriting e-mail to one pre-determined recipient
> by cron on Redhat 6.2.  I've created a gawk script and simply need
> cron to run this script to let me know that it has completed
> running the gawk script.
> 

You will find an answer by typing :


   perldoc -q mail

at some prompt.  Of course there is no reason you need to use Perl to do this
you could use a shell script or you could do it directly in awk - if you so
decide you should ask in the appropriate newsgroup.

/J\


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

Date: 20 Jun 2000 10:48:50 +0100
From: nobull@mail.com
Subject: Re: simplest e-mail script in the world wanted
Message-Id: <u91z1s8yyl.fsf@wcl-l.bham.ac.uk>

Kirk Sansom <info@sansom.net> writes:

> I am a totally programming novice and urgently need a simple
> script to send a prewriting e-mail to one pre-determined recipient
> by cron on Redhat 6.2.  I've created a gawk script and simply need
> cron to run this script to let me know that it has completed
> running the gawk script.

Why do you want to do this in Perl?  Sure if you are fluent in Perl it
may make sense to do even trivial tasks in Perl but if you are not
then why not just do this in shell?

> The e-mail recipient, subject and body will stay the same such as:
> 
> To: administrator@mydomain.com
> Subject: the updates have been completed
> Body: The updates have been completed.

#!/bin/sh
echo  The updates have been completed. |
  mail -s "The updates have been completed" \
       administrator@mydomain.com

> That's it!  I can't seem to find such a simple script anywhere!

Nobody would write such a simple script in Perl.  If they did they
certainly wouldn't publish it.

Of course this whole thing is probably moot because STDOUT/STDERR
stream is automatically mailed to the owner of a cron job anyhow.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Tue, 20 Jun 2000 08:08:01 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Sorting a ':' delimeted file by a field value/surname. #2
Message-Id: <3950242f.1466607@news.skynet.be>

Jimmy Lantz wrote:

>I've now been looking for a good Manual for the function MAP, cause I
>don't really get 
>how the above code works. But it is working for me as desired!!

What you've got is known as the Schwartzian Tranform, signature being
the "map sort map". If you're really interested in how it works, see the
tutorial on:

	http://www.5sigma.com/perl/schwtr.html


As for map(): it takes a list of scalar arguments, it will run this code
block for each item in turn, with $_ set to the item (by reference, so
you can change the original), and it will return a list (array?) of the
results (last expression in code block). A simple example:

	my @ary = (1 .. 10);
	my @twice = map { 2 * $_ } @ary;
	print "@ary\n@twice\n";

10 items in, 10 out.

p.s. perl is case sensitive. Don't say MAP if you mean map().

-- 
	Bart.


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

Date: 20 Jun 2000 00:02:10 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: SSL session variable
Message-Id: <8im8pi$2bv$1@orpheus.gellyfish.com>

On Mon, 19 Jun 2000 14:16:30 GMT robb4444@my-deja.com wrote:
> Is there a session variable that you need to 'reset' after logging out
> of a ssl/https website?

Dunno.  Perhaps you should look in the SSL specification.

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


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

Date: 18 Jun 2000 14:27:55 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Unix database for Perl
Message-Id: <8iiior$p6p$1@orpheus.gellyfish.com>

On Fri, 16 Jun 2000 11:34:08 -0700 Steve Leibel wrote:
> In article <x6p25.4103$bc4.281608@news1.primary.net>, "Bob Tate"
> <btate@primary.net> wrote:
> 
>> Anyone know a good database for a Unix system that Perl will talk to.
> 
> Most people will suggest Mysql, the most popular free database.  However
> Mysql does not have transactions and does not implement all of the
> language, such as subqueries. 

Nor triggers, contraints and stored procedures (unless you have the
wherewithall to write a C shared library).  I have seriously taken against
MySQL after it fixed a corrupted index by altering the data to match the
index - thus deleting all the data - D'oh !

>                               I prefer Postgres, a free open-source
> database that has full SQL features.  You can download Postgres at
> http://www.postgresql.org/.
> 

I have PostgresSQL, MySQL and Informix SE on this machine and benchmarking
suggests that the latter is by far the most efficient but of course it is
not free on most platforms.

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


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

Date: 19 Jun 2000 23:48:16 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: URL Redirection
Message-Id: <8im7vg$vbm$1@orpheus.gellyfish.com>

On Tue, 20 Jun 2000 01:19:27 +0800 D-Rak wrote:
> Dear All,
> 
> I need help to script for url redirection. I need to know how to make this
> type of redirection using perl or cgi.. http ://www.mycompany.com/?123456
> 
> If anyone of you happens to know the method,please let me know asap.
> 

You read the parameters passed to your program and issue the appropriate
headers to trigger the redirection.  You will want to use a module such
as CGI.pm and/or ask in the group comp.infosystems.www.authoring.cgi as
thus far there is nothing Perl specific about this.

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


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

Date: 20 Jun 2000 00:01:10 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Use of split and join with special character
Message-Id: <8im8nm$25p$1@orpheus.gellyfish.com>

On Mon, 19 Jun 2000 14:30:43 +0200 Pablo Agirre wrote:
> "Rafael Garcia-Suarez" <garcia_suarez@hotmail.com> escribió en el mensaje
> news:slrn8ks1gh.vad.garcia_suarez@rafael.kazibao.net...
>> Pablo Agirre wrote in comp.lang.perl.misc:
>> >    How could I use an special character in a split call ?
>> >
>> >    I don't want to use "\\ |", because I need to use it also in a join
>> >expression.
>> >
>> >    my $delim = '|';
>> >    split (/$delim/, $line);
>>
>> Replace this by
>>     my $quoted_delim = quotemeta('|');
>>     split (/$quoted_delim/, $line);
>> which quotes all metacharacters with a backslash.
>> See also perldoc -f quotemeta.
>>
>> >...
>> >
>> >    join ($delim, ...)
>>
>> No quoting here, because join does not interpret $delim as a regular
>> expression.
>>
>     The $delim variable is user-defined, so the split and join functions
> must work with '|' and any other character teh user chooses. (':' or ',' or
> ...)
> 

Well yes.  But you have to take special measures if you want to use any
old character in the regular expression part of the split - so as has
been suggested :

  $quoted_delimiter = quotemeta($delim);

  @stuff = split /$quoted_delimiter/, $string;

  or

  @stuff = split /\Q$delim/, $string;

but you cant put any stuff in the first argument to join and it doesnt
matter as this is a plain string ...

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


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

Date: 19 Jun 2000 23:11:37 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: What the...
Message-Id: <8im5qp$obj$1@orpheus.gellyfish.com>

On Mon, 19 Jun 2000 09:33:33 -0700 Agentkhaki wrote:
> 
> exec() returned: 2: No such file or directory
> 

Your shebang line is incorrect.

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V9 Issue 3428
**************************************


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