[10785] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4386 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 9 05:07:55 1998

Date: Wed, 9 Dec 98 02:00:20 -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, 9 Dec 1998     Volume: 8 Number: 4386

Today's topics:
    Re: 80 column conversion (Tim Gim Yee)
        ANN: Ruby the object-oriented scripting language <matz@netlab.co.jp>
    Re: Better way to get values from a list? <uri@sysarch.com>
    Re: CGI Redirection (Bradley K. Farrell)
    Re: DBPerl <rakesh_puthalath@hotmail.com>
        Embedded Perl, or library? jbharvey@home.net
    Re: Embedded Perl, or library? <Marcin.Kasperski@softax.com.pl>
    Re: file locking question <sbekman@iil.intel.com>
    Re: Hash slices - why are these equivalent?... <dgris@moiraine.dimensional.com>
        HTML Embedded in Perl backslashxt@yahoo.com
    Re: Is there a 'predeclare subs' module ? <Alex.Davies@tiuk.ti.com>
    Re: log file analyzer - better way to do this? <thomas@fahle.de>
        Need a database editor <mgivens@kidswish.org>
    Re: Newbie: Secure directories?? (hymie!)
        Perl Modules, DOCS? backslashxt@yahoo.com
    Re: Perl/ Win32:  Displaying a msgbox/dialog box on a r <patrick.mulvany@no.spam.torrington.net>
        QUICK example Please??? <maierc@chesco.com>
    Re: QUICK example Please??? (Tad McClellan)
    Re: reg exp <rakesh_puthalath@hotmail.com>
    Re: reg exp (David Alan Black)
    Re: Sorting Associative Arrays <rakesh_puthalath@hotmail.com>
    Re: SSI from Perl on IIS (Martin Vorlaender)
    Re: String interpolation (was: PERL  -- What did I miss <jamie@powernetonline.com>
    Re: Y2K potential problem in localtime() (John Moreno)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Wed, 09 Dec 1998 07:40:04 GMT
From: tgy@chocobo.org (Tim Gim Yee)
Subject: Re: 80 column conversion
Message-Id: <366f1431.426466326@news.oz.net>

On Tue, 08 Dec 1998 14:50:21 -0500, John Moreno <phenix@interpath.com>
wrote:

>Tim Gim Yee <tgy@chocobo.org> wrote:
>
>> My cat walked across the keyboard, and this is what she came up with:
>
>Can I have that cat?

No, but I have a dog that does Visual Basic if anyone's interested.

>> sub linewrap {
>>     my $line = shift; defined $line or return '';
>>     my @data = split /\t/, $line;
>>     my $columns = shift || $columns;
>>     my $tabstop = shift || $tabstop;
>>     my $frag = '';
>>     my $col  = $columns - 1;
>> 
>>     for (@data) {
>>         $_ = "$frag$_";
>>         $frag = '';
>>         s/(.{1,$columns}$)|(.{1,$col}(?:\S\s+|-(?=\w)))|(.{$col})/
>
>Is this supposed to be taking care of the case where there isn't any
>place to break?

Yes, it happens at the last 'or' captured by $3.  That could have been
written more clearly:

  s/
    (.{1,$columns}$) | # $1: Short lines don't need wrapping.
    (.{1,$col}(?:      # $2:
      \S\s+|           #     Wrap after whitespace.
      -(?=\w))         #     Wrap after hyphen.
    ) |
    (.{$col})          # $3: Long lines with nowhere to break.
  / 
    $3 ? "$3-\n" :     # Add hyphen after breaking long lines.
    $2 ? "$2\n" :      # Break after whitespace and hypen.
    (($frag = $1), '') # Remove short lines.  Save for later.
  /gex;

>>             $3 ? "$3-\n" :
>>             $2 ? "$2\n" :
>>             (($frag = $1), '')
>>         /ge;
>>         $frag .= (' ' x ($tabstop - length($frag) % $tabstop));
>>     }
>> 
>>     local $_ = join '', @data, $frag;
>>     s/\s+$//gm;
>>     return $_;
>> } 

>>     http://www.chocobo.org/~tgy/moogle/perl/News/Wrap.pm
>> 
>> Hope it's useful to your task.
>
>Not really -- my main task was writing it in C as a library which could
>be used by newsreader authors.
>
>A question though -- it looks like what you need to pass to newswrap is
>a string containing lines that use the same quote prefix.  Is that the
>case or am I missing something?  

No, newswrap() will work with different lines and different quote
prefixes.

  $mark = q[>+:];
  $news = newswrap($news, $col, $tab, $mark);

$mark is a list of recognized quote prefixes.  Any combination of the
characters '>', '+', and ':' at the beginning of a line will be used
to identify that line as belonging to a particular chunk of quoted
text.  It does not limit the text in $news to lines beginning with
q[>+:].

>And those lines are wrapped using
>paragraph filling (i.e. the lines with the same prefix are merged into
>as few or as many lines as is needed to contain all of the text)?

Yes.  It breaks text into paragraphs, translates newlines in
paragraphs to spaces, wraps then rejoins.  Whitespace between
paragraphs is preserved.

It worked well for my purposes, except that it didn't take care of
'personal/ID quotes' such as:

  >>>>> "LW" == Larry Wall <larry@wall.org> writes:

    LW> It should be illegal to yell "Y2K" in a crowded economy.  :-)


-- 
Tim Gim Yee
http://www.dragonfire.net/~tgy/moogle/
"Kupo! Round and round you go! Moogle!"


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

Date: 09 Dec 1998 18:31:15 +0900
From: Yukihiro Matsumoto <matz@netlab.co.jp>
Subject: ANN: Ruby the object-oriented scripting language
Message-Id: <87lnkhzmos.fsf@ev.netlab.co.jp>

Hi.

I'd like to introduce you Ruby the object-oriented scripting language
from Japan, which:

  * is object-oriented from scratch.
  * is totally free, open-source language.
  * has exception handling.
  * has iterators and closures.
  * can load libraries dynamically.
  * is highly portable.  Runs on many UNIXen, Win32, Mac, BeOS, etc.
  * has user-level builtin thread feature available on all platforms.
  * is less cryptic than perl.  YMMV. :-)
  * runs faster than python.
  * has genuine conservative GC.
  * can mix C-defined method and Ruby-defined method in a class.
  * is easier to write extension libraries.
  * needs no ref-count maintenance in extension libraries.

Here's testimony from Germany:

  From: Clemens Hintze <c.hintze@gmx.net>
  > Like any programmer I know many programming languages. It has took me
  > three weeks to decide to learn Perl, one week for the decision to learn
  > Python and ONE day to decide to learn Ruby!!! 

Please check out http://www.netlab.co.jp/ruby/ for detail, try it, and
join us for happy programming.
						matz.


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

Date: 08 Dec 1998 23:49:34 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Better way to get values from a list?
Message-Id: <x7k901vs0x.fsf@sysarch.com>

>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:


  LR> @a = qw(one two a=b c=d three e=f);

  LR> timethese ( (1 << (shift || 0) ), {
  LR>     Join => sub { @result = join( "\n", @a ) =~ m/=(.+)$/mg },
  LR>     Map  => sub { @result = map /=(.*)/, @a },
  LR>     Push => sub { foreach (@a) { push @result, $1 if /=(.*)/ } },
  LR> } );
  LR> __END__

  LR> ActiveState 5.005_02 (mine, all mine)
  LR> Benchmark: timing 65536 iterations of Join, Map, Push...
  LR>       Join:  3 wallclock secs ( 4.52 usr +  0.00 sys =  4.52 CPU)
  LR>        Map:  4 wallclock secs ( 5.03 usr +  0.00 sys =  5.03 CPU)
  LR>       Push:  9 wallclock secs ( 8.55 usr +  0.09 sys =  8.64 CPU)

  LR> HP-UX 10.20 5.004_03 (loaded)
  LR> Benchmark: timing 65536 iterations of Join, Map, Push...
  LR>       Join: 22 secs ( 7.78 usr  0.06 sys =  7.84 cpu)
  LR>        Map: 39 secs ( 9.53 usr  0.08 sys =  9.61 cpu)
  LR>       Push: 43 secs (12.08 usr  0.32 sys = 12.40 cpu)

  LR> So, although not the shortest by far, your imaginative monstrosity
  LR> wins, Uri.  I, for one, am surprised!

who are you calling an imaginative monster? :-)

i thought that my only does 2 perl ops and the join loop has not as much
work to do as map or foreach. the single m//mg would definitely be
faster than multiple m//'s in those loops.

i wasn't surprised but very happy to win the speed prize. just typical
perl, you can go for brevity or speed (sometimes both!).

also ronald is right, you should rebench it with @results = (),
otherwise you are doing lots of reallocs in that code.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Wed, 09 Dec 1998 04:42:32 GMT
From: bradley@iinet.net.au (Bradley K. Farrell)
Subject: Re: CGI Redirection
Message-Id: <366dfdae.82283955@news.m.iinet.net.au>

"Simmo" <simsi@hotmail.com.nospam> wrote:
>Amazing how unhelpful some people can be eh?

And *your* response is helpful? (see below)

>The way i'd do this is to create a simple print qq~ html page in the perl
>script with a simple meta refresh tag to redirect.....but then i'm sure
>there are better ways....

It appears that you may not have read the whole thread before posting:
I wonder how your post contributes to the discussion when the point
you made had already been made before (see post by Aslan00001) AND had
already been rebutted by Randal and Alan.

But then again, maybe you didn't read the whole thread :(
-- 
Bradley K. Farrell
bradley@iinet.net.au


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

Date: Wed, 09 Dec 1998 14:29:51 +0800
From: Rakesh Puthalath <rakesh_puthalath@hotmail.com>
Subject: Re: DBPerl
Message-Id: <366E18DF.7365BEFC@hotmail.com>

Reusing sth 's ?
Check  finish of sth.

Ramesh B Vemulapalli wrote:

> Hello Guys,
>
> I am running Oracle using the DBI in perl and I keep getting
> the message:
>
> DBD::Oracle::st execute failed: ORA-01013: user requested cancel of current operation (DBD: oexfet error) at ./RegionInfo.pl line 121
>
> Why is this happening? When I run it again it is ok. Blows my mind. If you have an answer please respond to medavarm@usa.redcross.org
>
> Moorthy

 



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

Date: Wed, 09 Dec 1998 08:19:42 GMT
From: jbharvey@home.net
Subject: Embedded Perl, or library?
Message-Id: <yoqb2.2629$C06.1430@news.rdc1.sfba.home.com>




I'm looking to make use of Perl in an embedded fashion...as an interpreted
language for a virtual world.  Does Perl have the ability to be a library
and then linked into other programs?

Weird question, I know.


j
-- 
Justin B. Harvey
http://www.auspex.net/jbharvey


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

Date: Wed, 09 Dec 1998 08:58:45 GMT
From: Marcin Kasperski <Marcin.Kasperski@softax.com.pl>
Subject: Re: Embedded Perl, or library?
Message-Id: <366E3BD9.4FF531AF@softax.com.pl>

jbharvey@home.net wrote:
> 
> I'm looking to make use of Perl in an embedded fashion...as an interpreted
> language for a virtual world.  Does Perl have the ability to be a library
> and then linked into other programs?
> 

It has. I use it so. 
The best known example is mod_perl Apache module.
You have some docs. Try:

perldoc perlembed

-- 
Marcin Kasperski
Marcin.Kasperski@softax.com.pl


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

Date: Wed, 09 Dec 1998 11:36:34 +0200
From: Bekman Stanislav <sbekman@iil.intel.com>
To: umsee <NOSPAM_umsee@microasia.com>
Subject: Re: file locking question
Message-Id: <366E44A2.31D2@iil.intel.com>

umsee wrote:
> 
> I have a file which might be read or write by my program. And I am using both
> linux AND windows NT version of perl.
> 
> My question is:
> 
> Can I open the file and read it while another program lock the file and write
> to it?
> 
> Do I need to lock the file if I am only reading it (the other program might be
> locking it for writing)?
> 
> Thanks You!!

http://www.esafe.com/stas/TULARC/webmaster/myfaq.html#1

______________________________________________________________________
Stas Bekman mailto:sbekman@iil.intel.com http://www.eprotect.com/stas  
Visit: http://www.eprotect.com/stas/TULARC (Perl,CGI,Linux,Web,Java,PC)


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

Date: 08 Dec 1998 21:11:20 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Hash slices - why are these equivalent?...
Message-Id: <m3btleuf87.fsf@moiraine.dimensional.com>

rjk@linguist.dartmouth.edu (Ronald J Kimball) writes:

> Simon Parsons <simonp@ftel.co.uk> wrote:
> 
> > # (2)
> > @{%h}{@a} = ();
> > 

>   DB<2> @{%h}{@a} = ();
> Bizarre copy of HASH in leave at (eval 5) line 2, <IN> chunk 2.
>
> 
> It doesn't work.

Yes, it does.  It just doesn't work in the debugger.

$ perl -w
@a = ('a' .. 'z');
@{%h}{@a} = ();
print join ' ', keys %h, "\n";
__END__
a b c d e f g h i j k l m n o p q r s t u v w x y z 
$ 

I tried to figure out what's going on here, and realized that I have
no idea how to debug the debugger.  I think that I saw a message
somewhere around here about this (debugger debugging) in the last few
days, but I'll have to find it.

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: Wed, 09 Dec 1998 06:22:29 GMT
From: backslashxt@yahoo.com
Subject: HTML Embedded in Perl
Message-Id: <74l4v4$c6m$1@nnrp1.dejanews.com>

I have a problem in trying to output HTML along with the output of a perl
script. What I would like to do is have a perl script populate some of the
data in a html page. Basically, what I would like to do is open an external
HTML file and in the HTML page have the variable names (ie: $name, $url,
$email) in the HTML code. When Perl reads the HTML file, it should populate
the data, but the scipt rather takes all variable names as literal
characters.

Any suggestions?
Charles (PS: Please email a copy as well)

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


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

Date: Wed, 09 Dec 1998 09:28:02 +0000
From: Alex Davies <Alex.Davies@tiuk.ti.com>
To: Mark-Jason Dominus <mjd@op.net>
Subject: Re: Is there a 'predeclare subs' module ?
Message-Id: <366E42A2.617AF10E@tiuk.ti.com>

Mark-Jason Dominus wrote:

> In article <366D7DD8.47681C0F@tiuk.ti.com>,
> Alex Davies  <Alex.Davies@tiuk.ti.com> wrote:
> >
> >Is there a way of automatically predeclaring _all_  your
> >subroutines, kinda like:
>
> I tried to get it to work with __DATA__, to eleminate the dependency
> on $0, but that didn't work, because __DATA__ isn't opened until it's
> too late.
>
> >(but with the necesary bells and whistles...) ?
>
> I think you're going to have a hard time getting it exactly right.
> For example:
>
>         sub
>         fred
>         { $_[0]{F} = qq{
>         sub actually_this_is_really_a_string { "that looks like a sub" }
>         }
>
> I tried
>
> while (<D>) {
>   next unless /^\s*sub\s*(([_A-Za-z]\w*)\s*[^\{]*)/;
>   eval "sub $1;";
>   if ($@) {
>     require Carp;
>     Carp::carp("Couldn't predeclare subroutine `$2': $@.\n");
>   }
> }
>
> in an attept to get it to handle prototypes correctly.
>
> >Or is this a bad idea ... ;)
>
> I think it's an awful idea.
>

 Harsh...but fair ;)

>
> Not that that stoped me from working on it.

> Here's my new, improved version.  It caches the function declarations
> in a separate file; next time you run it, it tries to read this file
> back in at compile time instead of grovelling over the source code.
> If the file is out-of-date, it rebuilds it.  The declarations for the
> file `foo.pl' are stored in (where else?) `foo.h'.
>
> If you're sure that .h file is good, and should never be rebuilt, add
> the line
>
>         $H_FROZEN = 1;
>
> to it somewhere.  If it has that, it won't be rebuilt even if it's out
> of date.
>
> It should be safe to use in modules (with `Module.pm' getting its own
> `Module.h' file) but I haven't tested that.
>
> If you want me to take your name off of it, I'll understand.
> Otherwise it's going up on my web site and you'll get full credit.
>

Thanks for the kudos, (or is it "infamy" as in Carry on Cleo...)

alex.

> ################################################################
> # allsubs.pm
> # Usage:
> #   use allsubs;
> # Locate and pre-declare all the subroutines in your file.
> # (With caching.  I love caching.  Everything should be cached.)
> #
> # Retarded concept by Alex Davies (Alex.Davies@tiuk.ti.com)
> # Idiotic module copyright 1998 M-J. Dominus (mjd-perl-allsubs@plover.com)
> # Who is the greater pinhead?  You decide.
> #
>
> my $mainfile = (caller)[1];
> my $H = $mainfile;
> print "H: $H\n";
> $H =~ s/\.[^.]*$//;    # foo.xy.pl => foo.xy.h.
> $H .= '.h';            # Would     => foo.h  have been better?
> eval { require $H };
> my $err = $@;
> my $ood = 0;
>
> return if $H_FROZEN;
>
> if (!$err) {
>   my $hfile = $INC{$H};
>   my $main_mtime = (stat $mainfile)[9];
>   my $h_mtime = (stat $H)[9];
>   $ood = ($h_mtime < $main_mtime);
>   if ($ood && !rename $H, "$H.bak") {
>     require Carp;
>     Carp::croak("Could not remove out-of-date prototype file `$H': $!;
> aborting");
>   }
> }
>
> if ($@ || $ood) {
>   local *D;
>   local *H;  # Greetings, miserable Earth vermin.
>   open D, $0 or die "$0: $!";
>   unless (open H, "> $H") {
>     require Carp;
>     Carp::carp("Warning: couldn't write file $H: $!.\n");
>     undef $H;
>   }
>
>   while (<D>) {
>     next unless /^\s*(sub\s*([_A-Za-z]([\w]|::)*)\s*[^\{]*)/;
>     print H $1, ";\n" if defined $H;
>     eval "$1;";
>     if ($@) {
>       require Carp;
>       Carp::carp("Couldn't predeclare subroutine `$2': $@.\n");
>     }
>   }
>   print H "1;\n" if defined H;
> }
>
> "Cogito, ergo sum.";         # A required file must return a true value.
>
> #
> #
> ################################################################
>
> Hope this helps.  Have an obfuscated day.



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

Date: Wed, 09 Dec 1998 06:15:12 -0800
From: Thomas Fahle <thomas@fahle.de>
Subject: Re: log file analyzer - better way to do this?
Message-Id: <366E85F0.15FD@fahle.de>

j wrote:
> 
> I'm writing a log file analyzer for the ISP I work for, not
> so much for the company, but just for fun.Try,
Apache::ParseLog


Thomas


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

Date: Wed, 9 Dec 1998 03:41:26 -0600
From: "Mark Givens" <mgivens@kidswish.org>
Subject: Need a database editor
Message-Id: <74lgls$5vo@sjx-ixn10.ix.netcom.com>

Hello, I am searching for a PERL based password protected program that will
allow me to edit, add, delete, etc. records in a pipe delimited database.
Any one know of a simple app that will suffice?

--
Mark Givens
mark.givens@everywebsiteintheworld.com

http://www.everywebsiteintheworld.com/
Is your site listed here?  It should be!




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

Date: 9 Dec 1998 04:01:51 GMT
From: hymie@lactose.smart.net (hymie!)
Subject: Re: Newbie: Secure directories??
Message-Id: <74ksnf$i76$1@news.smart.net>

In our last episode, the evil Dr. Lacto had captured our hero,
  "Christian H. Knudsen" <webmaster@bluegalaxy.hypermart.net>, who said:
>I have a directory with a 700 permission. I would like a script
>to be able to change the permission to 777 (for example),

>My problem is that the script (naturally) isn't able to chmod
>the dir to 777 because of the 700 permission!

Naturally?

term43:guest {3} mkdir z
term43:guest {4} chmod 700 z
term43:guest {5} ls -l
total 6
drwx------  2 guest  guest  512 Dec  6 09:58 guest
drwx------  2 guest  guest  512 Dec  6 14:23 nsmail
-rw-r--r--  1 guest  guest    0 Dec  8 22:58 typescript
drwx------  2 guest  guest  512 Dec  8 22:58 z
term43:guest {6} perl
chmod (0777,z);
term43:guest {7} ls -l
total 24
drwx------  2 guest  guest  512 Dec  6 09:58 guest
drwx------  2 guest  guest  512 Dec  6 14:23 nsmail
-rw-r--r--  1 guest  guest    0 Dec  8 22:58 typescript
drwxrwxrwx  2 guest  guest  512 Dec  8 22:58 z
term43:guest {8} 
term43:guest {23} perl -v

This is perl, version 5.004_04 built for OpenBSD.i386-openbsd


 ..hymie!         http://www.smart.net/~hymowitz         hymie@lactose.smart.net
===============================================================================
Every time I see the Dakota, I think about that night.
Shots ringing out, the angry shout, a man losing his life. 
It's something we shouldn't dwell upon, but it's something we shouldn't ignore.
Too many good men have been cut down. Let's pray there won't be any more.
                                                              --Christine Lavin
===============================================================================


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

Date: Wed, 09 Dec 1998 06:29:00 GMT
From: backslashxt@yahoo.com
Subject: Perl Modules, DOCS?
Message-Id: <74l5bb$cas$1@nnrp1.dejanews.com>

Hi,

I'm reading up on the standard modules included in Perl and I'm wondering if
there's any sources on the web for detailed documentation. I learn mostly by
example and through the .pm files, I have trouble trying to understand the
details and flexibility of the modules and what we can do with them. Any
additional resources would be of help ;)

Thanks
Charles

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


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

Date: Wed, 09 Dec 1998 09:50:31 +0000
From: Patrick Mulvany <patrick.mulvany@no.spam.torrington.net>
Subject: Re: Perl/ Win32:  Displaying a msgbox/dialog box on a remote display?
Message-Id: <366E47E7.55198971@no.spam.torrington.net>

If the machines that you wish to display the messages on are NT based you might want
to try using the Messaging service to send a network broadcast.

NET SEND {name | * | /DOMAIN[:name] | /USERS} message

Just tested something that I never thought would work... but it did...

NET SEND /DOMAIN:ip_address message

(note ip_address = xxx.xxx.xxx.xxx NOT \\xxx.xxx.xxx.xxx)

This will send a Message to the ip provided it is running the NT Messaging .. If the
message appears somewhere else I have no idea but it does solve the problem if you
are running NT both ends.

Paddy
Learns something new..... again...


"Matthew H. Gerlach" wrote:

> I'm probably going out on a limb here, but your question isn't really
> a perl question per say.  It is a win32 windowing question.  You are
> trying to get one PC generate an image on another PC.  While Xwindows
> is designed from the ground up for this sort of thing, Windows from
> Micro$oft is not designed well for this sort of thing.
>
> What you could do is create a program on the display PC "listening" for
> display requests and have the PC generating the display "talk" to that program
> and ask it to actually display a message box.  Depending on your needs
> this display server could be quite simple, or you could just use an Xserver
> running on the PC.
>
> Good Luck,
> Matthew
>
> In article <366C1142.875CA0E@ti.com> kpifer@ti.com writes:
> >Howdy!
> >
> >I have met with very limited success finding an answer to this by reading the
> >documentation for Perl modules I've found.
> >
> >Perl for Win32, I want to display a msgbox/dialog box on a remote PC, of the
> >flavor that InitiateSystemShutdown does, given the computer name \\something or
> >an IP address.
> >
> >Does anyone know where I can find, or if there is, a module that has this
> >functionality and if there i any documentation on how to use it.
> >
> >Thanks,
> >Kurt Pifer
> >
> >



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

Date: Tue, 08 Dec 1998 23:24:05 -0500
From: Charles Maier <maierc@chesco.com>
Subject: QUICK example Please???
Message-Id: <366DFB65.19EDA5BF@chesco.com>


I know I am thinking too hard on this.. but I want to write a perl
script to validate the operation of a data-rich website from a REMOTE
site. I do not want to FTP pages from the site... I want to have the
script:

1. submit a url request (just like from a browser)
2. record the responce the website sends back (the webpage [the HTML])

The data coming back will be a HTML page... since the call to the
website (the url) is, of itself, enough parameters to let the website
know what page-content to send.

Is this 'doable' from a remote website perl script?? Can anyone please
show a simple example?? It sounds simple.. mental block!!  ;o)


TIA..
-- 
Chuck


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

Date: Tue, 8 Dec 1998 23:23:57 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: QUICK example Please???
Message-Id: <dh1l47.hd2.ln@magna.metronet.com>

Charles Maier (maierc@chesco.com) wrote:

: I want to have the
: script:

: 1. submit a url request (just like from a browser)
: 2. record the responce the website sends back (the webpage [the HTML])

: The data coming back will be a HTML page... since the call to the
: website (the url) is, of itself, enough parameters to let the website
: know what page-content to send.

: Is this 'doable' from a remote website perl script?? Can anyone please
: show a simple example?? It sounds simple.. mental block!!  ;o)


-------------------------
#!/usr/bin/perl -w

use LWP::Simple;

$page = get('http://www.perl.org/');

print $page;
-------------------------


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 09 Dec 1998 13:56:32 +0800
From: Rakesh Puthalath <rakesh_puthalath@hotmail.com>
Subject: Re: reg exp
Message-Id: <366E110F.9A7CBCD3@hotmail.com>

try quotemeta \Q, if you suspect some quoting problem
 

Tri Tram wrote:

> Hi there, I was just wondering how to do a regular expression?
>
> I have read my mail file into a variable called $temp
> So I have something like this:
>
> $w = <STDIN>;
> chomp($w);
>
> if ($w =~ /$temp/)
> {
>   print "found\n";
> }
> else
> {
>   print "not found\n";
> }
>
> except that give me the error:
>
> /: unmatched () in reg.
>
> so I tried something like
> if ($w =~ /$temp/mo)
> but I still get the same error.  So I was wondering what am I doing wrong?
> I think that the $temp has some special characters like (), [], $, and other
> characters that could try to be extrapolated again.  So I was wondering
> how to prevent that after the first one?  I thought /o would do it, but
> I guess not.
>
> --
> -----------------------------------------------------------------
> Tri Tram, Computer Science and Engineering at UCLA
> http://www.seas.ucla.edu/~tram

 



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

Date: 9 Dec 1998 03:37:31 -0500
From: dblack@pilot.njin.net (David Alan Black)
Subject: Re: reg exp
Message-Id: <74lcsb$47e$1@pilot.njin.net>

Hello -

tram@olympic.seas.ucla.edu (Tri Tram) writes:


>Hi there, I was just wondering how to do a regular expression?

>I have read my mail file into a variable called $temp
>So I have something like this:

>$w = <STDIN>;
>chomp($w);

>if ($w =~ /$temp/)
>{
>  print "found\n";
>}
>else
>{
>  print "not found\n";
>}


Are you sure you want to test for the presence of the pattern
represented by the contents of your mail file in the one-line
input, and not the other way around?


David Black
dblack@pilot.njin.net


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

Date: Wed, 09 Dec 1998 15:48:47 +0800
From: Rakesh Puthalath <rakesh_puthalath@hotmail.com>
Subject: Re: Sorting Associative Arrays
Message-Id: <366E2B5F.F513A0BA@hotmail.com>

> But it does not work... I know I am going really wrong somewhere and I
> dont

How ?. @sort does not contain any elements ? or it is not getting sorted ?

BTW $a->{'radius'} numeric or alpha ?.



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

Date: Wed, 09 Dec 1998 06:32:23 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: SSI from Perl on IIS
Message-Id: <366e0b67.524144494f47414741@radiogaga.harz.de>

scott@softbase.com wrote:
: Mark Polakow (mpolakow@emergemarketing.com) wrote:
: > I am running Perl on win32 on MS IIS and generally it runs great. However I
: > am trying to do SSI calls
:
: IIS doesn't support SSI.

Correct for IIS v2 and v3, wrong for IIS v4.

cu,
  Martin
--
                        | Martin Vorlaender | VMS & WNT programmer
 VMS is today what      | work: mv@pdv-systeme.de
 Microsoft wants        |       http://www.pdv-systeme.de/users/martinv/
 Windows NT 8.0 to be!  | home: martin@radiogaga.harz.de


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

Date: Tue, 8 Dec 1998 23:10:47 -0600
From: "jamie dolan" <jamie@powernetonline.com>
Subject: Re: String interpolation (was: PERL  -- What did I miss?)
Message-Id: <YFnb2.856$ww5.71621@homer.alpha.net>

I got it working.  Thanks for all the help.

--Jamie D.





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

Date: Wed, 9 Dec 1998 00:54:11 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: Y2K potential problem in localtime()
Message-Id: <1djqvb1.v8s21u1sjnl0kN@roxboro0-059.dyn.interpath.net>

<finsol@ts.co.nz> wrote:

> In article <01be22f2$9aab4c20$a4c448c2@is>,
>   "Simmo" <simsi@hotmail.com.nospam> wrote:
> > Hi,
> >
> > Apologies if this has been posted or if i'm doing something silly but i've
> > noticed in my localtime() calls that when the year gets to 2000, the year
> > gets returned as 100.
> 
> Warning, Simmo, Perl programmers can get very tetchy when this subject is
> discussed. According to the experts out there is no problem with
> localtime()usage - despite continued evidence to the contrary such as yours.
> Their opinion is that anyone who does misuse it should not be programming.
> Many Perl programmers are certainly not amenable to having other programmers
> alerted to the issue via this forum.
> 
> If you would like to learn more about the 'booby trap code' problem and the
> associated programmer denial, you can access my articles published in
> Computerworld at URL:
> http://www.ts.co.nz/~finsol/y2k_articles.htm
> 
> You are not alone in misunderstanding the localtime() year value.

Actually this just shows that YOU are so worried about the Y2K that YOU
are misunderstanding simple perl:

He wrote:
>| for 4 character returns:
>| 
>| $year = $year + 1900;

which is absolutely correct.  He also wrote:
>| or if you want 2 character returns:
>|
>| if ($year > 99)
>| {
>|  $year = $year - 100;
>|  if ($year < 10)
>|  {
>|   $year = "0$year";
>|  }
>| }

Which is a Y3K, bug (but it doesn't look like it was caused by
misunderstanding localtime, but instead in not expecting the program to
be in use then -- which is THE classic date bug).

It should have been this (which is useful now).

$year = $year % 100;
$year = "0$year" if ($year < 10);

Of course if he had consulted the documentation or checked back in this
group he might have saved himself the trouble and not have created a Y3K
bug.

-- 
John Moreno


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

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

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