[10996] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4596 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 8 19:01:11 1999

Date: Fri, 8 Jan 99 16:00:13 -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           Fri, 8 Jan 1999     Volume: 8 Number: 4596

Today's topics:
    Re: Adding a path to the @INC variable (Randal L. Schwartz)
    Re: calling ksh functions from perl <kvraman@lucent.com>
    Re: Need CGI database <perlguy@technologist.com>
        Net::FTP and file permissions <ryan@secretshopnet.com>
    Re: Net::FTP and file permissions (Stephen Clouse)
        possible bug in perl format with ~~ <jlewis@gnv.fdt.net>
    Re: regexp and broken MY reference <aqumsieh@matrox.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 08 Jan 1999 15:25:20 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Adding a path to the @INC variable
Message-Id: <m1d84pqrdr.fsf@halfdome.holdit.com>

>>>>> "mike808" == mike808  <mike808@my-dejanews.com> writes:

mike808> The 'use' is executed just like it was in its own BEGIN block.
mike808> Try *2* begin blocks, one after the other, as in:

mike808> BEGIN { $MyDir = '/path/to/some/dir'; }
mike808> BEGIN { use lib "$MyDir/goo"; }

No, the BEGIN on the second block is redundantly redundant.

As yet another run on this, let's try this:

	use constant MyDir = '/path/to/some/dir';
	use lib MyDir."/goo";

which works because everything happens at compiletime.

print "Just another Perl hacker,"

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Fri, 08 Jan 1999 17:08:42 -0600
From: Venkatraman Krishnan <kvraman@lucent.com>
To: Clay Irving <clay@panix.com>, nair@ee.tamu.edu
Subject: Re: calling ksh functions from perl
Message-Id: <36968FFA.7DB9B730@lucent.com>

The ksh script has functions like get_changed_values().
I need to call these functions from my perl script and get the return values of these
functions. How do I accomplish this?

venky

Clay Irving wrote:

> In <369676E6.7494240A@lucent.com> Venkatraman Krishnan <kvraman@lucent.com> writes:
>
> >How can I call functions implemented in ksh shell scripts from perl?
>
> Could it be as simple as:
>
> This shell script:
>
>    #!/bin/ksh
>
>    echo "Howdy"
>
> This Perl program:
>
>    #!/usr/local/bin/perl -w
>
>    system("foo.ksh");
>
> This output from the Perl program:
>
>   Howdy
>
> --
> Clay Irving
> clay@panix.com





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

Date: Fri, 08 Jan 1999 17:16:48 -0600
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: Need CGI database
Message-Id: <369691E0.D1290FDA@technologist.com>

If you are looking for something free, I wrote an article with a script
that will do what you are looking for..

It can be found at http://webreview.com or more directly from my site
at: http://www.inlink.com/~perlguy/simple

Good luck!
Brent
-- 
Java?  I've heard of it, it is what I drink while hacking Perl! -me
+----------------------------------------+
|            Brent Michalski             |
|         -- Perl Evangelist --          |
|    E-Mail: perlguy@technologist.com    |
| Resume: http://www.inlink.com/~perlguy |
+----------------------------------------+


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

Date: Fri, 08 Jan 1999 23:09:04 GMT
From: Ryan Gendron <ryan@secretshopnet.com>
Subject: Net::FTP and file permissions
Message-Id: <36969076.BD0A389@secretshopnet.com>

This is a multi-part message in MIME format.
--------------6D94EC52DD51C6ABAB9B3B04
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi All

I wrote a program that uses Net::FTP to move files around.  Everything
is fine except for the fact the the permissions - which are not carried
correctly to the remote host.

As there is no chmod with Net::FTP, that module alone is insufficient.

I am unsure as to the best solution here - can someone help me out?

--------------6D94EC52DD51C6ABAB9B3B04
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Ryan Gendron
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Ryan Gendron
n:              Gendron;Ryan
org:            <br><a href="http://www.secretshopnet.com"><img border=0 src="http://www.secretshopnet.com/gifs/ecom6.gif"></a><br>
adr:            501, 1202 Centre Street S.;;;Calgary;Alberta;T2G 5A5;Canada
email;internet: ryan@secretshopnet.com
title:          Senior Web Developer
tel;work:       (403) 261-5000 ext.211
tel;fax:        (403) 261-4999
x-mozilla-cpt:  ;0
x-mozilla-html: TRUE
version:        2.1
end:            vcard


--------------6D94EC52DD51C6ABAB9B3B04--



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

Date: Fri, 08 Jan 1999 23:28:02 GMT
From: see.sig@for.address (Stephen Clouse)
Subject: Re: Net::FTP and file permissions
Message-Id: <3697929c.23658451@news.kc.net>

On Fri, 08 Jan 1999 23:09:04 GMT in message
<<36969076.BD0A389@secretshopnet.com> comp.lang.perl.misc>, Ryan Gendron
<ryan@secretshopnet.com> wrote:

>there is no chmod with Net::FTP

Because that's not how FTP servers implement chmod.  Consider studying your
server's SITE command.

-- 
Stephen Clouse -- steve at acme-labs dot com (Anti-Spam enabled)
Acme Labs -- Resident Megalomaniac (http://www.acme-labs.com)


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

Date: Fri, 8 Jan 1999 18:18:55 -0500
From: Jon Lewis <jlewis@gnv.fdt.net>
Subject: possible bug in perl format with ~~
Message-Id: <Pine.LNX.4.05.9901081802470.24988-100000@yoda.fdt.net>

I'm having some trouble with a perl format that contains things like:

Notes:
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$sr_notes
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~
$sr_notes

According to the docs, this should print as many lines as necessary to
output the full contents of $sr_notes.  What I've found is that if
$sr_notes contains any \r\n's, perl seems to miscalculate how much of
$sr_notes has been printed, and $sr_notes ends up getting truncated.

Have I misunderstood how ~~ works, or is this a bug?

I'm using perl 5.004 on Linux.

------------------------------------------------------------------
 Jon Lewis <jlewis@fdt.net>  |  Unsolicited commercial e-mail will
 Network Administrator       |  be proof-read for $199/message.
 Florida Digital Turnpike    |
______http://inorganic5.fdt.net/~jlewis/pgp for PGP public key____



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

Date: Fri, 8 Jan 1999 12:31:43 -0500 
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: regexp and broken MY reference
Message-Id: <x3yd84p7jsw.fsf@tigre.matrox.com>


Marty Landman <marty@catnmoose.com> writes:

>  open (Signon,"$Signon") || die "cannot open  sign-on file $!\n";

You don't really need to double quote $Signon here, but anyway .. 

>  my $HTML;
>  $HTML .= $_ while <Signon>;

There is an easier way to do this:
{ local $/ = <>; $HTML = scalar <Signon> }

>  no strict;
>  $HTML =~ s/\$(\w+)/${$1}/g;
>  use strict;
> 
> --    I found that use strict gave compile errors so I turned it off for
> the substitution.  Is this proper thinking?

I would say "NO", but again, there is an easier way to do this:
{ no strict; $HTML =~ s/\$(\w+)/${$1}/g }

Well .. that was easier for me. You might not feel the same way though.

> The main reason I'm posting though is that originally I had the '$1'
> vble declared as local, i.e. if I'm looking to substitute  the value of
> $japh into the text where it says $japh, i'd coded
> 
> my $japh = 'just another perl hacker';
> 
> This didn't work, but you already knew that.  So I 'fixed' it if that's
> the right word by adding $japh to my 'use vars' quoted word list instead
> of having it as a 'my' vble declared in the subroutine.
> 
> What am I missing here?  How can I do this better, and not have a global
> variable which could otherwise happily exist as local?

I would create a hash of variable names and their associated values:

%hash = (
	japh => "just another perl hacker,"
	var1 => $string1,
	varn => $stringn,
);

Then, you could do something like:

$HTML =~ s/\$(\w+)/$hash{$1}/g;

this won't bother use strict.

Hope this helps,
Ala



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

Date: 12 Dec 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 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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