[26001] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 8220 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 1 18:05:32 2005

Date: Fri, 1 Jul 2005 15:05:09 -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           Fri, 1 Jul 2005     Volume: 10 Number: 8220

Today's topics:
    Re: "Variable ... is not imported..."   using an import <pilkowsk@informatik.uni-marburg.de>
        LWP and speedstream router <techsupp-nospam-@helpconsulting.net>
    Re: LWP and speedstream router <tadmc@augustmail.com>
        String question <no@email.presently>
    Re: String question <1usa@llenroc.ude.invalid>
    Re: String question <noreply@gunnar.cc>
    Re: Validating XML data <1usa@llenroc.ude.invalid>
    Re: Validating XML data <tadmc@augustmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 1 Jul 2005 21:00:00 +0200
From: Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de>
Subject: Re: "Variable ... is not imported..."   using an imported variable from a module
Message-Id: <3ili4aFm346pU1@individual.net>

* Brian McCauley schrieb:
> Fabian Pilkowski wrote:
> 
> [ In the context of an example .pm file ]
> 
>>     #!/usr/local/bin/perl -w
> 
> There's no shebang line in a module.

You're right. But it is not disallowed to put a comment in the first
line of a module file. It was just a silly thing to let this comment
looking like a shebang line ... ;-)

> 
>>     package import_pack;
>>     use strict;
> 
> You forgot use warnings.  Probably because you thought the shebang line 
> would do it.

Yes, that's what I thought. I mistaked perl modules for perl scripts in
this case.

thanks for correcting,
fabian


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

Date: Fri, 1 Jul 2005 14:29:44 -0400
From: "KenK" <techsupp-nospam-@helpconsulting.net>
Subject: LWP and speedstream router
Message-Id: <8eada$42c58b9a$438ce4af$32403@ALLTEL.NET>

Hi all,

I'm trying to use LWP on one of my Linux servers to reboot the speedstream 
5200 router.

I'm sorta stuck at the authorization stage. (ie beginning).
One of the things I've tried is the following;

#!/usr/bin/perl

use HTTP::Request::Common qw/POST/;

$req = POST http://192.168.254.254;
$req->authorization_basic("user","pass");

use LWP;

my $browser = LWP::UserAgent->new;

$res = $browser->request($req);


Essentially the script just hangs.  Any suggestions would be greatly 
appreciated.

Thanks,
Ken




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

Date: Fri, 1 Jul 2005 16:05:55 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: LWP and speedstream router
Message-Id: <slrndcbc1j.5mi.tadmc@magna.augustmail.com>

KenK <techsupp-nospam-@helpconsulting.net> wrote:

> $req = POST http://192.168.254.254;

> Any suggestions would be greatly 
> appreciated.


Put quotes around strings.

Enable warnings.

Enable strict.


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


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

Date: Fri, 01 Jul 2005 23:30:21 +0300
From: GeekX <no@email.presently>
Subject: String question
Message-Id: <da494n$ivl$2@phys-news1.kolumbus.fi>

How to select substring?

from: "abcde *:; fghijkl mno pqrstuwxyz"

I want: everything between and icluding  "cde" and "stu".
That is:  "cde *:; fghijkl mno pqrstu"

Thanks!



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

Date: Fri, 01 Jul 2005 20:54:28 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: String question
Message-Id: <Xns9686ABFF326D9asu1cornelledu@127.0.0.1>

GeekX <no@email.presently> wrote in news:da494n$ivl$2@phys-
news1.kolumbus.fi:

> How to select substring?
> 
> from: "abcde *:; fghijkl mno pqrstuwxyz"
> 
> I want: everything between and icluding  "cde" and "stu".
> That is:  "cde *:; fghijkl mno pqrstu"

Please read the posting guidelines for this group. They contain 
invaluable information on how you can help yourself, and help others 
help you.

perldoc -f index
perldoc -f substr

or, you can use a capturing regex match.

#!/usr/bin/perl

use strict;
use warnings;

my $s = "abcde *:; fghijkl mno pqrstuwxyz";
my $start = index $s, 'c';
my $end = index $s, 'w';
my $r = substr$s, $start, $end - $start;

print $r."\n";

if($s =~ /(c.+u)/ ) {
    print $1."\n";
}
 
__END__

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


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

Date: Fri, 01 Jul 2005 23:12:00 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: String question
Message-Id: <3ilpt1Fm5dqvU1@individual.net>

GeekX wrote:
> How to select substring?

Do not multi-post!!
http://www.uwasa.fi/~ts/http/crospost.html

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Fri, 01 Jul 2005 20:45:17 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Validating XML data
Message-Id: <Xns9686AA7042E68asu1cornelledu@127.0.0.1>

Vikrant <vikrantREMOVE@DELETEsaysnetsoftDDDD.com> wrote in
news:da3r4u$m78$1@domitilla.aioe.org: 

> #!usr/bin/perl
> 
> use strict;

use warnings;

missing.

> use XML::LibXML();
> 
> $sXML = "<?xml version='1.0' ?>

my $sXML = <<EXML
<?xml version='1.0' ?>
<ping_monitor>
	<monitor_ip>10.0.0.4</monitor_ip>
	<monitor_ip>10.0.0.2</monitor_ip>
<ping_monitor>
EXML
 
> Now if I need to check the xml validity in $sXML

I think you are confusing well-formedness with validity. This document 
does not specify a DTD, so there cannot be an issue of validity.

Sinan
-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


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

Date: Fri, 1 Jul 2005 15:26:07 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Validating XML data
Message-Id: <slrndcb9mv.5mi.tadmc@magna.augustmail.com>

Vikrant <vikrantREMOVE@DELETEsaysnetsoftDDDD.com> wrote:


> I am receiving XML data over a TCP socket. How do I validate the 
> incoming data as a valid XML ?

> I am not very proficient 
> in Perl


Consider using a programming language that you _are_ familiar 
with then.


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


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

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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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


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