[23118] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5339 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 9 21:05:50 2003

Date: Sat, 9 Aug 2003 18:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 9 Aug 2003     Volume: 10 Number: 5339

Today's topics:
    Re: "Undefined subroutine" error (but it's defined, I t <bwalton@rochester.rr.com>
    Re: data structure help <jkeen@concentric.net>
    Re: DBI suddenly not working... <jim.bloggs@eudoramail.com>
    Re: Enumerate all the remote drives <bwalton@rochester.rr.com>
    Re: help needed making unicode entities <jidanni@jidanni.org>
        In loop wait for function return <cmustard_!SPAM@nyc.rr.com>
    Re: In loop wait for function return <NOSPAM@bigpond.com>
        Location problem (Ron Spears)
    Re: Location problem (Tad McClellan)
    Re: Location problem <erichmusick@myrealbox.com>
    Re: Perfect perl IDE! <jwillmore@cyberia.com>
    Re: Perfect perl IDE! <member32241@dbforums.com>
    Re: Perfect perl IDE! <penny1482@comcast.net>
    Re: Perfect perl IDE! ctcgag@hotmail.com
    Re: Perfect perl IDE! (Tad McClellan)
    Re: Perfect perl IDE! <matthew.garrish@sympatico.ca>
    Re: PERL, FTP and Browser Upload <NOSPAM@bigpond.com>
        Piped input to one-liners being truncated <tnitzke@att.net>
        possible to execute system command on remote host? (dan baker)
    Re: possible to execute system command on remote host? <matthew.garrish@sympatico.ca>
    Re: possible to execute system command on remote host? (Tad McClellan)
    Re: Print - format /  presentation question <matthew.garrish@sympatico.ca>
    Re: Renaming Files inside a GZ Zip File <mikeflan@earthlink.net>
        Request For Information And Steering - IPC, Java, Perl, <mooseshoes@gmx.net>
    Re:  <bwalton@rochester.rr.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 09 Aug 2003 22:55:44 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: "Undefined subroutine" error (but it's defined, I think?)
Message-Id: <3F357BE8.1080704@rochester.rr.com>

valerian2@hotpop.com wrote:

> I have a program divided into 3 modules plus a main script, and some of
> the modules call functions within other modules.  Most of the time this
> works fine, but occasionally I get an error like this:
> 
>>Undefined subroutine &My::Misc::DB_Disconnect called at My/Misc.pm line 18.
>>
> even though I made sure the caller (here Misc.pm) had imported all the
> functions of the other module.  Hence, I don't understand the reason


No you didn't.  See comments at end.


> behind this error.  I can get it to work fine by just replacing the
> DB_Disconnect() call in Misc.pm with &My::Misc::DB_Disconnect(), but

DB------------------------------------------^^^^


> that seems like a kludge, and I'd like to get a better understanding of
> what's going on. :-)
 ...
> ----- ~/test.pl ---------------------------------
> #!/usr/bin/perl -w
> 
> use strict;
> use My::DB;
> use My::Misc;
> 
> my $dbh = DB_Connect();
> SafeError($dbh, '/dev/null is full!');
> 
> 
> ----- ~/My/DB.pm --------------------------------
> # Database functions
> package My::DB;
> 
> use strict;
> use Exporter;
> use My::SOAP;  # XXX this line causes the problem
> use vars qw(@ISA @EXPORT);
> @ISA = ('Exporter');
> @EXPORT = qw(DB_Connect DB_Disconnect);
> 
> sub DB_Connect {
>     # stub function, always returns true
>     my $dbh = 1;
>     return ($dbh);
> }
> 
> sub DB_Disconnect {
>     # stub function, always returns true
>     my ($dbh) = @_;
>     return (1);
> }
> 
> 1;
> 
> 
> ----- ~/My/Misc.pm ------------------------------
> # Miscellaneous functions (error handling, logging, untainting, etc.)
> package My::Misc;
> 
> use strict;
> use Exporter;
> use My::DB;
> use vars qw(@ISA @EXPORT);
> @ISA = ('Exporter');
> @EXPORT = qw(SafeError);
> 
> sub SafeError {
>     my ($dbh, $msg) = @_;
> 
>     print "Error: $msg\n";
> 
>     if ($dbh) {
>         print "Disconnecting from DB...\n";
>         DB_Disconnect($dbh);
>     }
> 
>     exit 1;
> }
> 
> 1;
> 
> 
> ----- ~/My/SOAP.pm ------------------------------
> # SOAP functions, for exchanging data with remote site
> package My::SOAP;
> 
> use strict;
> use Exporter;
> use My::Misc; # XXX this line causes the problem
> use vars qw(@ISA @EXPORT);
> @ISA = ('Exporter');
> @EXPORT = qw(GetRemoteData);
> 
> sub GetRemoteData {
>     # stub function, always returns true
>     return (1);
> }
> 
> 1;
> 
> 

Note in:

    perldoc -f use

that use() calls require().  Note in

    perldoc -f require

that require() keeps track of which modules have been loaded in %INC (a 
global variable, always in package main).  Therefore, when the use() 
function is called, it will do something only if that module has not 
already been loaded.  So each module will be loaded exactly once. 
Subsequent calls to use() will not do anything.  Therefore, when you use 
Exporter; to export your sub's, it only happens during the first use() 
of your module.  Thus, the export of your sub names happens only the 
first time a given modules is use()'d.

Basically, you are misusing (pun intended) the module mechanism in an 
attempt to simply define subs.  If all you want is for all your subs to 
be present even though they are defined in other files, simply do() the 
other files, and forget modules and packages.  When you properly use 
modules, you do not share subs (in modules, properly called methods).

 From the docs for Exporter:

    "Do not export method names!

     Do not export anything else by default without a good reason!

     Exports pollute the namespace of the module user. If you must 
export try
     to use @EXPORT_OK in preference to @EXPORT and avoid short or common
     symbol names to reduce the risk of name clashes."

You are trying to use use() wrong.  Read up on the various 
object-oriented docs and buy "Object Oriented Perl" and read it.

-- 
Bob Walton



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

Date: 09 Aug 2003 18:47:47 GMT
From: "James E Keenan" <jkeen@concentric.net>
Subject: Re: data structure help
Message-Id: <bh3fkj$aml@dispatch.concentric.net>


"slash" <satishi@gwu.edu> wrote in message
news:30fe9f1e.0308081032.a1b045f@posting.google.com...
> Hi,
> I have been struggling with this for a while and could certainly use
> some help.
> I am using the Text::Table module for performing ngrams and trying to
> add the corresponding filename information to whatever file that's
> being processed. In other words, given a file.txt, i do my ngrams and
> select to output specific columns. At the end of each line, I want to
> add the text file name. Can someone please help me with how I should
> go about this.

I suspect that the reason why your posting has not elicited a response is
that to adequately diagnose your problem one would have to install two
non-standard modules, Text::Table and Text::Aligner (on which Text::Table
depends), and readers of this list are not likely to install modules just to
respond to postings.  You might do somewhat better on
comp.lang.perl.modules -- and have you looked at Text::Ngram?

But since you asked for any suggestions on your code ...
(1) Have you tried running your script with 'use warnings; use strict;'?
Your understanding of use of 'my' to scope variables appears confused.
>         foreach $word ( @words ) {    # not scoped with 'my'
[snip]
>         my @lines = $tb->add("$stack[-4]", "$stack[-3]", "$stack[-2]",
> "$stack[-1]", "*");
>         my @lines = $tb->add("$stack[-3]", "$stack[-2]", "$stack[-1]",
> "-1", "-1");
>         my @lines = $tb->table($line_number, $n);
[above would generate a warning]

(2) What's your rationale for slurping all the data in at once (undef $/) as
opposed to line-by-line processing?  Such modification of $/ should be
scoped to the smallest possible block.

> undef $/;
>         my @words = split /\W+/, <> ;

Jim Keenan




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

Date: Sun, 10 Aug 2003 00:45:42 +0100
From: "doofus" <jim.bloggs@eudoramail.com>
Subject: Re: DBI suddenly not working...
Message-Id: <bh4138$tj9mh$1@ID-150435.news.uni-berlin.de>

Tad McClellan wrote:
> doofus <jim.bloggs@eudoramail.com> wrote:
>> Tad McClellan wrote:
>>> doofus <jim.bloggs@eudoramail.com> wrote:
>>>
>>>>> If I put the line 'use DBI' anywhere in my program it gives up
>>>>> and
>>>
>>>> OK. Just for the record, I seem to have fixed it by reverting to
>>>> 5.6.
>>>
>>> Errr, from what?
>>>
>>> You never told us what perl version you had.
>>>
>>> If knew you are backing up from 5.8.0, then I'd make a guess at
>>> why you are having the problem, but I don't so I won't.
>>
>> Oh, go on, do. :-)
>
>
> OK.
>
> 5.8.0 is not binary compatible with earlier versions.
>
> Modules with a C component (XS) need to be recompiled for 5.8.0.

Thanks! That was very informative. Now I know what XS means.

I don't know whether it's good news or bad, though. I guess it means
that there will have to be two binaries on the ppm thingy, one for 5.8
and one for 5.6, at least for C component modules. {:-(

But this certainly could explain a lot of problems I've been having.
Thanks again.

I wonder if there is really any point trying to run perl on Windows? It
must be *way* easier installing all those powerfull modules on Linux.
--
doofus




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

Date: Sat, 09 Aug 2003 20:03:50 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Enumerate all the remote drives
Message-Id: <3F35539F.3040307@rochester.rr.com>

Gary Chan wrote:

> I want to write a perl script that enumerates all the local drive names 
> that are connecting to remote drives in Windows. I think 
> Win32::NetResource is one of the possible module but I can't figure out 
> how to do this.
 ... 
> Gary
> 

Win32::NetResource seems to have issues with removable-media drives with 
no media loaded.  You might try capturing and processing the output from 
the DOS command "NET USE".  Your mileage may vary depending upon your 
version of Windoze.  Something like:

    for(`net use`){print "$1 $2\n" if /([A-Z]:)\s*(.*)/}

perhaps [tested on Windoze 98SE, AS Perl 806].

-- 
Bob Walton



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

Date: Sun, 10 Aug 2003 06:43:46 +0800
From: Dan Jacobson <jidanni@jidanni.org>
Subject: Re: help needed making unicode entities
Message-Id: <8765l6wixp.fsf@jidanni.org>

>> as a batch job (no mozilla)?

Alan> My mention of Mozilla was very much an aside - but if you want to
Alan> convert an HTML document from any known coding, into one using a
Alan> specific coding - say utf-8 - or using &#number; notations, then it's
Alan> quite a handy tool, it seems to me, thanks to its syntax-awareness.

Alan> But of course something like HTMLtidy,

Ugg. http://article.gmane.org/gmane.comp.web.html-tidy.devel/1197

Tidy: too many surprises upon updates. By the way, any alternatives
for keep one's html tidy?

Alan> or SP, can do that too.

$ dlocate -L sp|sed -n 's@.*/man1/\(.*\)\.1\.gz@\1@p'|xargs apropos -e
spent (1)            - print SGML entity on the standard output
sgml2xml (1)         - convert SGML to XML
sgmlnorm (1)         - normalize SGML documents
nsgmls (1)           - a validating SGML parser
spam (1)             - an SGML markup stream editor

I recall HTML is a subset of SGML or something, but looks like I'm
barfing up the wrong tree.

Alan> Or XML tools if you're using XHTML.

I'm using plain HTML.

Alan> [In perl] to apply :utf8 semantics to an already-open filehandle
Alan> you use the extended form of binmode().

perldoc -f binmode has no eye grabbing example.


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

Date: Sat, 09 Aug 2003 20:44:39 GMT
From: mUs <cmustard_!SPAM@nyc.rr.com>
Subject: In loop wait for function return
Message-Id: <X2dZa.111703$852.20426@twister.nyc.rr.com>

I would like to loop through a few URL's utilizing the LWP::Simple get function.
Using the existing 'logic' ( or lack thereof ) is there a way to have the 
script wait before executing the next iteration of the for loop. At the moment
the 'get' function does not have enough time to complete its' request.
I looked into fork, wait, exec, etc but those don't seem to be what i'm looking
for. I though 'eval' would do it but it doesn't. thanks


#!/usr/bin/perl -w

use strict;
use diagnostics;
use LWP::Simple;             
require HTML::TokeParser;

my $url = 'http://localhost/page.html'; 
my $url2 = 'http://localhost/page2.html'; 
my $url3 = 'http://localhost/page3.html';
my @urls = qq($url $url2 $url3);

# yes, of course this works
#die "LWP::Simple is empty: $! " unless ( parse_page(my $webPage = get($url)));

# loop does not give LWP::Simple function get enough time to 
# return before looping, just dies

for my $page (@urls) {
      die "cant get web page: $!\n" unless ( my $webPage = get($page));
      # eval does not die, exits with success but nothing sent to 
      # function
      #eval {($webPage = get($page));}; die $@ if $@; # returns ok
      #eval {&parse_page($webPage = get($page));}; die $@ if $@; #return ok but
                                        # nothing send to function, script dies
}


sub parse_page {
  shift ,etc
}


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

Date: Sun, 10 Aug 2003 10:03:50 +1000
From: "Gregory Toomey" <NOSPAM@bigpond.com>
Subject: Re: In loop wait for function return
Message-Id: <bh4258$tjr0l$1@ID-202028.news.uni-berlin.de>

"mUs" <cmustard_!SPAM@nyc.rr.com> wrote in message
news:X2dZa.111703$852.20426@twister.nyc.rr.com...
> I would like to loop through a few URL's utilizing the LWP::Simple get
function.
> Using the existing 'logic' ( or lack thereof ) is there a way to have the
> script wait before executing the next iteration of the for loop. At the
moment
> the 'get' function does not have enough time to complete its' request.
> I looked into fork, wait, exec, etc but those don't seem to be what i'm
looking
> for. I though 'eval' would do it but it doesn't. thanks

The get function returns a string, usually containing HTML. It generally
takes 1-2 seconds to run for me.

If you are saying that the web server at the other end takes a long time to
return you request, or does not return at all, then maybe he URL is wrong or
the web server is overoaded? Have you tried typing the URLs in a browser?

Forking of subprocesses does not solve the underlying problem.

gtoomey






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

Date: 9 Aug 2003 16:01:56 -0700
From: ronspear_tx@yahoo.com (Ron Spears)
Subject: Location problem
Message-Id: <304a0e4e.0308091501.1ef13c2a@posting.google.com>

Hello,

Is there a simple way to pass a variable from a Perl script to a HTML
page using a location redirect?


print $loc = "Location:http://www.website.com/confirm.htm\n";
print "$loc\n\n";

What I want is something like this, but it doesn't work:

print $loc = "Location:http://www.website.com/confirm.htm?passed_variable\n";
print "$loc\n\n";


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

Date: Sat, 9 Aug 2003 18:46:57 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Location problem
Message-Id: <slrnbjb1vh.72l.tadmc@magna.augustmail.com>

Ron Spears <ronspear_tx@yahoo.com> wrote:

> print $loc = "Location:http://www.website.com/confirm.htm?passed_variable\n";
> print "$loc\n\n";


Why are you printing the same thing two times?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sun, 10 Aug 2003 00:19:07 GMT
From: "Erich Musick" <erichmusick@myrealbox.com>
Subject: Re: Location problem
Message-Id: <%bgZa.107466$o%2.47552@sccrnsc02>

Yeah - that's why it doesn't work.

Try:

my $loc = "Location: http://www.website.com/confirm.htm?passed_variable";
print "$loc\n\n";

-- 
Erich Musick
http://erichmusick.com




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

Date: Sat, 09 Aug 2003 15:33:57 GMT
From: James Willmore <jwillmore@cyberia.com>
Subject: Re: Perfect perl IDE!
Message-Id: <20030809113555.2ae18a8d.jwillmore@cyberia.com>

> I want to start learning perl with a really good IDE.
> 
> Any suggestions?
> 
> (free IDE)

Hum ..... an IDE for Perl ..... I'm thinking this question has been
asked several times, several different ways, in this news group.

However, to get you started, you could use:

vi
emacs
gvim
Xemacs
Notepad
DOS Edit

Yes - all of these are editors, and not IDE's.  But hey, if you read
the documentation that came with Perl, you might have answered your
own question.  perldoc is the command to get documentation on Perl.
Specifically, type:

perldoc perlfaq3

The answer is there.  And to get a listing of all the Perl
documentation, type:

perldoc perl

You could also try learning the language before getting an IDE.  IDE's
are only useful if you know the language.  In some cases, if you know
the language very well, an IDE is counter productive - because you're
limited to the functionality of the IDE.

Just my thoughts ......

HTH

Jim


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

Date: Sat, 09 Aug 2003 18:06:43 +0000
From: dominant <member32241@dbforums.com>
Subject: Re: Perfect perl IDE!
Message-Id: <3221049.1060452403@dbforums.com>


The perldoc command is useful but is there in an HTML format or PDF?
Looking for a brief documentation!

--
Posted via http://dbforums.com


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

Date: Sat, 9 Aug 2003 13:59:12 -0700
From: "Dick Penny" <penny1482@comcast.net>
Subject: Re: Perfect perl IDE!
Message-Id: <Cjmdnf-0YYnF_aiiU-KYvA@comcast.com>


"> The perldoc command is useful but is there in an HTML format or PDF?
> Looking for a brief documentation!
NO!! that's probably the poorest part of Perl is its documentation.
There's too much of it,
lots of it is old,
lots of it is done by *nixers who *assume*  all sorts of stuff,
there is no simple way to search for a term/name because the current AS
Perl's docs are in html
(an eariler version had docs done by MS doc system (don't know what to call
it) and you could do
global searches. MUCH BETTER IMHO),
lots of best stuff (say on OOP), is scattered all over the WEB.

It really is all there, but, a real PAIN to find & use.

Re original Q re IDE, I am happy with TextPad from the UK. License is $25 I
think. I just push a macro-button to have current script run, and results
returned. I have never once run anything at CLI, can't even think of why I
would want to.

Dick Penny




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

Date: 09 Aug 2003 21:05:58 GMT
From: ctcgag@hotmail.com
Subject: Re: Perfect perl IDE!
Message-Id: <20030809170558.748$Sf@newsreader.com>

dominant <member32241@dbforums.com> wrote:
> The perldoc command is useful but is there in an HTML format or PDF?
> Looking for a brief documentation!

How would translating to a PDF or HTML format make the documentation
briefer?

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service              New Rate! $9.95/Month 50GB


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

Date: Sat, 9 Aug 2003 17:07:09 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Perfect perl IDE!
Message-Id: <slrnbjas4d.6t1.tadmc@magna.augustmail.com>

dominant <member32241@dbforums.com> wrote:
> 
> The perldoc command is useful but is there in an HTML format


The perl distribution has a program that can convert the std docs
from POD to HTML:

   perldoc pod2html


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sat, 9 Aug 2003 18:34:27 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Perfect perl IDE!
Message-Id: <QFeZa.6000$ox5.682308@news20.bellglobal.com>


"Dick Penny" <penny1482@comcast.net> wrote in message
news:Cjmdnf-0YYnF_aiiU-KYvA@comcast.com...

> there is no simple way to search for a term/name because the current AS
> Perl's docs are in html

http://www.perldoc.com/

All the searching you could ever want. I'll agree that the naming of the
docs doesn't help a newbie (I suppose that's what perltoc is for), but it
does start to make sense the more you use them.




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

Date: Sun, 10 Aug 2003 10:16:20 +1000
From: "Gregory Toomey" <NOSPAM@bigpond.com>
Subject: Re: PERL, FTP and Browser Upload
Message-Id: <bh42sm$u5ch6$1@ID-202028.news.uni-berlin.de>

"prsjm3qf" <steve@caralan.co.uk> wrote in message
news:3F34A9F9.419CAD8B@caralan.co.uk...
> Hello out there,
>                       I'm a bit of a Perl newbie and have dropped for
> the job of writing a file upload system.
> I've tried various HTTP solutions with form ACTION=POST but have found
> it unreliable for large files because of server timeout errors and
> anyway, it's a protocol not really designed for the job.
> I'm now thinking that the grown up way to do it has got to be with  FTP.

As an aside, www.geocities.com has an excellent upload facility for users
uploading files to their web sites. I think itsjust browser based. Have a
look at how they do it.

gtoomey




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

Date: Sat, 9 Aug 2003 13:10:11 -0800
From: "tnitzke" <tnitzke@att.net>
Subject: Piped input to one-liners being truncated
Message-Id: <103.7.9.13.10.11.tnitzke@att.net>

I'm working from Windows 2000 and a lot of my use of Perl involves writing general purpose 
batch files and using them from one-liners.  The first time I ran into this problem I 
was quite mystified until I figured out what was going on.  It seems that piped input to a 
one-liner that runs a Perl program nested inside a batch file only executes the first line 
of input.  I wondered if anybody here could shed some light on why this is occuring?  I'm able 
to work around it, but I'm still curious what is going on.

As an example lets assume I have a file named "servers" with a list of machines running
MS SQL Server.  I would like to check the SQL Server version for each machine in the list.
The following two one-liners should produce the same output.  Yet the first one stops 
after the first machine in the list.  Following the two one-liners, is the listing for
"select.bat" that each one-liner runs via "system".


type servers | perl -ne "print; chomp; $cmd=qq(select $_ master \"select \@\@version\"\n);  system $cmd;"

perl -e "open S,'servers';while(<S>){print;chomp;$cmd=qq(select $_ master \"select \@\@version\");system $cmd;}"

================== select.bat ===================================================
@echo off
perl -x -S %0 %*
goto endofperl
#!perl
use DBI;
use strict; use warnings;
die "usage is select <server> <database> <select statement>\n" if $#ARGV < 2;
my ($srvr, $db, $sql) = @ARGV;
my $dsn = "driver=SQL Server;server=$srvr;database=$db;trusted_connection=Yes";
my $dbh = DBI->connect("dbi:ODBC:$dsn", '', '');
my $sh = $dbh->prepare($sql);
$sh->execute();
print join "|", @{ $sh->{NAME} }, "\n";
while (my @row = $sh->fetchrow_array) {
        print join "|", @row, "\n";
}
__END__
:endofperl
============== end of select.bat ==================================================



--------------
tnitzke
perl -e "($_=qq-dfwbh%nxigh%obchvsf%asfz%voqysfn-)=~tr+%o-za-mn+ a-iJk-lPn-y'+;eval"


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

Date: 9 Aug 2003 12:50:41 -0700
From: botfood@yahoo.com (dan baker)
Subject: possible to execute system command on remote host?
Message-Id: <13685ef8.0308091150.4f486754@posting.google.com>

I have a couple clients with domains on a remote host that uses cPanel
for domain management. I use a basic old version of ws_ftp to
upload/download files. So far everything has been mostly fine.

Lately the host has gotten increasingly slow in making minor tweaks to
accounts; such as creating a symbolic link to the statistics directory
which is not under the www dir by default for instance. what I am
wondering is if I can use a perl script to execute a system command
like:
ln -s testlink somedir

possible?

d


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

Date: Sat, 9 Aug 2003 16:57:38 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: possible to execute system command on remote host?
Message-Id: <2fdZa.5969$ox5.670145@news20.bellglobal.com>


"dan baker" <botfood@yahoo.com> wrote in message
news:13685ef8.0308091150.4f486754@posting.google.com...
> what I am
> wondering is if I can use a perl script to execute a system command
> like:
> ln -s testlink somedir
>

Anything is possible, but in your case probably not likely to work. Since
you don't mention shell access, and as it wouldn't have necessitated your
posting here, I'll assume that that is not an option. So, all you can do is
create a mini script that attempts that system call and see whether it
succeeds or not (call it up in your browser of choice, since you have no
other way of executing scripts remotely). What luck you will have depends on
what commands your host has given access to to the anonymous web user (and
allowing users to create symbolic links anywhere they want on the system is
surely not a good thing).

Matt




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

Date: Sat, 9 Aug 2003 17:11:07 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: possible to execute system command on remote host?
Message-Id: <slrnbjasbr.6t1.tadmc@magna.augustmail.com>

dan baker <botfood@yahoo.com> wrote:

> what I am
> wondering is if I can use a perl script to execute a system command
> like:
> ln -s testlink somedir


You do not need a "system command", you can make symbolic
links with native Perl:

   perldoc -f symlink


> possible?


Try it and see.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sat, 9 Aug 2003 12:43:35 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Print - format /  presentation question
Message-Id: <Tw9Za.9450$pq5.1212638@news20.bellglobal.com>


"Tad McClellan" <tadmc@augustmail.com> wrote in message
news:slrnbj9oml.5i1.tadmc@magna.augustmail.com...
>
> Enabling warnings often provides clues.
>

Which I normally do (see previous post for the working example I started
with). I didn't want to be guilty of tinkering with the example provided by
Eric (which was his downfall earlier), and since he didn't have warnings
enabled, and since I already knew the original was parsable... I should have
known I was making too many assumptions.

In writing it for the command line, I decided to tinker a little and see if
perl would still handle the expression without the outer braces, which it
did, albeit only in appearance, so I posted the one-liner without any
further thought. Not specifying the useless -l option would have been as
effective, as the lack of a newline would have been just as informative as
anything the warnings had to offer, but you are right.

Matt




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

Date: Sun, 10 Aug 2003 00:49:21 GMT
From: Mike Flannigan <mikeflan@earthlink.net>
Subject: Re: Renaming Files inside a GZ Zip File
Message-Id: <3F359721.EF48014F@earthlink.net>


ctcgag@hotmail.com wrote:

> Are you sure they are actually a gzip files, as opposed to WinZip files
> that someone named with a .gz at the end?
>
> Anyway, I'd just loop on something like this:
>
> system "zcat $oldfilename.tif.gz | gzip > $newfilename.tif.gz"
>
> (I don't know if zcat actually exists under windows.)
>
> Xho

Not positive, but I still think so.

zcat is not on my Win2000.  I tried it and it is an
"unrecognized command".

I got all the files renamed.  It took about 8 hours of
computer time to get it completed.


Thanks for all the help,


Mike



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

Date: 10 Aug 2003 00:50:00 GMT
From: mooseshoes <mooseshoes@gmx.net>
Subject: Request For Information And Steering - IPC, Java, Perl, etc.
Message-Id: <bh44ro$bj1@dispatch.concentric.net>

All:

I am writing a Perl program, the purpose of which is to asynchronously feed
short messages to multiple clients running on remote computers (PC's,
mostly).  The messsages will be machine (IP address) specific and the
number of clients is expected to scale up to 1 million in number as a
design requirement.  The clients will be Java applets which will allow the
client to run on any machine facilitating a compatible JRE or equivalent.

The communication between server and client is expected to have two primary
types engagement, the first of which is more bi-directional (login,
database updates, etc.) and the second of which is a mode where the client
is mostly listening for new messages from the server.

I am new to inter-process communications and would be interested to learn
what the likely technologies are for an application such as the one
described above.  And given that, what are some good resources for learning
more about them?  I am prepared to get my hands dirty and learn a thing or
two in the process.

The reason I am asking is that I have heard things about Sockets, RMI, RPC,
SOAP and CORBA, each of which could be a possible approach given the
various tradeoffs.  having some initial input from the community should aid
my choices and help me identify information resources more readily.

Thank you in advance for your thoughts.

Best,

Moose




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

Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: 
Message-Id: <3F18A600.3040306@rochester.rr.com>

Ron wrote:

> Tried this code get a server 500 error.
> 
> Anyone know what's wrong with it?
> 
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {

(---^


>     dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
 ...
> Ron

 ...
-- 
Bob Walton



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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 5339
***************************************


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