[28524] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9888 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 25 09:05:42 2006

Date: Wed, 25 Oct 2006 06:05:05 -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           Wed, 25 Oct 2006     Volume: 10 Number: 9888

Today's topics:
    Re: "Did not find leading dereferencer" - new findings  <ro.naldfi.scher@gmail.com>
    Re: "Did not find leading dereferencer" - new findings  <bol@adv.magwien.gv.at>
    Re: "Did not find leading dereferencer" - new findings  <bol@adv.magwien.gv.at>
    Re: ability to match / detect acronyms ? <josef.moellers@fujitsu-siemens.com>
    Re: Automatic login to a web page <jagjeet.malhi@gmail.com>
        Control Modelsim simulation from Perl Script <pjsenthil@gmail.com>
    Re: help needed <bik.mido@tiscalinet.it>
    Re: help needed <bik.mido@tiscalinet.it>
    Re: help needed <tadmc@augustmail.com>
        hexdump (was: Re: What's wrong) <rvtol+news@isolution.nl>
    Re: How can i find source code like Data::Dumper in per anno4000@radom.zrz.tu-berlin.de
    Re: I have no problems eating cereal...after it softens <zen13097@zen.co.uk>
    Re: I have no problems eating cereal...after it softens <bwilkins@gmail.com>
    Re: I have no problems eating cereal...after it softens <zen13097@zen.co.uk>
    Re: LWP and Javascript -- Not The Same Old Question <joe@inwap.com>
    Re: multiline <rvtol+news@isolution.nl>
        Setting permissions on remote directory using Net::SFTP timothy.hill@gmail.com
    Re: string substitution for a file, without replacing p <bik.mido@tiscalinet.it>
    Re: use of variables <michael_perle@yahoo.com>
    Re: Use system to start a server then execute commands  <joe@inwap.com>
    Re: using File::Find with big files on Linux <bik.mido@tiscalinet.it>
    Re: using File::Find with big files on Linux <bik.mido@tiscalinet.it>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 25 Oct 2006 00:10:33 -0700
From: "Ronny" <ro.naldfi.scher@gmail.com>
Subject: Re: "Did not find leading dereferencer" - new findings to an old puzzle
Message-Id: <1161760233.462234.240040@i42g2000cwa.googlegroups.com>


Ferry Bolhar schrieb:

> Ronald Fischer:
>
> > Note that I'm doing a "use strict" in my module (and of course -w).
> > Here, the string passed to the function bladename was supposed to
> > contain a %B, but I had made a typo and wrote $B, which is an
> > interpolation of the variable $B, which happens to be undefined.
> > The compiler should issue an error, that $B is not known,
> > but instead I got the "Dereferencer" error.
>
> Is this a compile-time or run-time error?

It happens at compile time.

> Is bladename()
> declared or imported?

In this case, it is imported from an other module, but this has nothing
to do with the "Dereferencer" error, because on the first example I
mentioned, I got that error message in the context of Perl standard
functions
solely.

Ronald



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

Date: Wed, 25 Oct 2006 11:31:53 +0200
From: "Ferry Bolhar" <bol@adv.magwien.gv.at>
Subject: Re: "Did not find leading dereferencer" - new findings to an old puzzle
Message-Id: <1161768713.578219@proxy.dienste.wien.at>

> In this case, it is imported from an other module, but this has nothing
> to do with the "Dereferencer" error, because on the first example I
> mentioned, I got that error message in the context of Perl standard

This error is reported by the "Text::Balancer" module, it doesn't
come from the Perl core:

"Did not find leading dereferencer":
 "extract_variable" was expecting one of '$', '@', or '%' at the
start of a variable, but didn't find any of them.

Maybe this will help you?

Greetings, Ferry

-- 
Ing Ferry Bolhar
Magistrat der Stadt Wien - MA 14
A-1010 Wien
E-Mail: bol@adv.magwien.gv.at





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

Date: Wed, 25 Oct 2006 13:02:16 +0200
From: "Ferry Bolhar" <bol@adv.magwien.gv.at>
Subject: Re: "Did not find leading dereferencer" - new findings to an old puzzle
Message-Id: <1161774139.895781@proxy.dienste.wien.at>

I wrote:

> This error is reported by the "Text::Balancer" module

Sorry, was a typo. I meant "Text::Balance_d_".

Greetings, Ferry

-- 
Ing Ferry Bolhar
Magistrat der Stadt Wien - MA 14
A-1010 Wien
E-Mail: bol@adv.magwien.gv.at




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

Date: Wed, 25 Oct 2006 09:40:16 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: ability to match / detect acronyms ?
Message-Id: <ehn4gl$cnm$2@nntp.fujitsu-siemens.com>

Chris Mattern wrote:
> In article <ehi1ih$d6l$1@nntp.fujitsu-siemens.com>, Josef Moellers wrot=
e:
>=20
>>John W. Kennedy wrote:
>>
>>>anno4000@radom.zrz.tu-berlin.de wrote:
>>>
>>>
>>>>Jack <jack_posemsky@yahoo.com> wrote in comp.lang.perl.misc:
>>>>
>>>>
>>>>>Jack wrote:
>>>>>
>>>>>
>>>>>>Hi I was wondering if anyone had any code to detect / match / ident=
ify
>>>>>>acronyms (AAA, BD) , essentially these are non words..besides just
>>>>>>detecting the capitals of course.
>>>>
>>>>
>>>>Some acronyms are words,
>>>
>>>
>>>All acronyms are words, by definition.
>>
>>There are acronyms that
>>1. you couldn't pronounce, e.g. WWW,
>=20
>=20
> WWW isn't an acronym.
>=20
>=20
>>2. you can pronounce (in some language) but they aren't "proper words" =

>>in most languages, e.g. "USA"
>=20
>=20
> USA isn't an acronym.
>=20
>=20
>>3. you can pronounce and they are "proper words" in at least some=20
>>language, e.g. "ARM: Advanced RISC machine, RISC: Reduced Instruction=20
>>Set Computer".
>>
>>I guess Anno was referring to 3.
>>
>=20
> That's because 3 is the definition of acronym, as Anno noted.

Thanks. I learn something new every day.

Josef
--=20
Josef M=F6llers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize
						-- T.  Pratchett



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

Date: 25 Oct 2006 00:42:15 -0700
From: "Jagjeet_Singh" <jagjeet.malhi@gmail.com>
Subject: Re: Automatic login to a web page
Message-Id: <1161762135.654980.9080@k70g2000cwa.googlegroups.com>

Thanks Zentara and Brian Wilkins for your reply.

This is mentioned in my isp login page "Cookies must be enabled"

I ran All three examples -- Please excuse me If I was not able even to
execute it properly


I took the first code and copied in  1.pl file.

and run like " perl 1.pl"

It gave me this output ..

Can't locate WWW/Mechanize.pm in @INC (@INC contains:
/usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at
1.pl line 4.


and with second example [ using LWP::UserAgent] I copied it to 2.pl and
run it by same way

and it prints all the html code of browser ---



And with third example [ using Curl ]

I ran it like "perl 3.pl" but it is not giving any output and comming
outout with fraction of second.

Please tell me if I am not running/doing the things properly.

My ISP login page can be accessed using
"http://210.7.90.193/indexmain.php"

I replaced variables with my url and username,password.

Regards,
Jagjeet Singh



Brian  Wilkins wrote:
> zentara wrote:
> > On 23 Oct 2006 23:32:29 -0700, "Jagjeet_Singh" <jagjeet.malhi@gmail.com>
> > wrote:
> >
> > >I am new to perl and do not have any idea about this language.
> > >I need your help to solve my problem.
> > >
> > >I have internet access on my desktop but each time my machine got
> > >rebooted I need to log-in on
> > >my ISP web's page by providing username,password and submit the button.
> >
> > >But I do not know perl, If this code is really small, can anyone post
> > >it ..
> > >
> > >Or if it takes time to write this then please provide me some from
> > >where I can learn something to write this code.
> > >
> > >like -- I use this url  "  http://my_isp_ip_address/indexmail.php" and
> > >there are only 3 fields.
> > >
> > >1 --  text box for username
>
>
> > >2 --   text box for password
> > >3 --  "Submit" button
> > >
> >
> > I'll give you some tips. First get something like tcpick or ethereal, so
> > you can watch in realtime what is going on during your login. Do it
> > from their webpage a few times and see what is actually happening.
> >
> > Then you can use WWW::Mechanize to simulate it. Their are tons of
> > examples on the net, and WWW::Mech has alot of examples, look in the
> > man3 subdir of the module distribution.
> >
> >  A simple example
> > #!/usr/bin/perl
> > use warnings;
> > use strict;
> > use WWW::Mechanize;
> >
> > my $username = 'user';
> > my $password = 'pass';
> > my $url      = 'http://www.xyz.com/Login.aspx';
> > my $mech     = WWW::Mechanize->new(autocheck => 1);
> >
> > $mech->get( $url );
> > $mech->form_name("login form name");
> > $mech->field("username", $username);
> > $mech->field("password", $password);
> > $mech->click("login button/submit name");
> >
> > $mech->content() =~ /sm.th. from Track.aspx/ and print "logged in\n"
> > __END__
> >
> >
> > As an alternative to WWW::Mechanize, you can also use a combination of
> > LWP::UserAgent and HTTP::Request::Common
> >
> > #!/usr/bin/perl
> > use warnings;
> > use strict;
> > use HTTP::Request::Common qw(GET POST);
> > use LWP::UserAgent;
> >
> > my $url ="http://my_isp/login.cgi";
> >
> > my $ua = new LWP::UserAgent(timeout=> 5);
> >
> > #now actually post the form
> > my $request = POST $url, [
> >    username => 'foobar',
> >    password => 'foobaz',
> >    ];
> >
> > my $response = $ua->request($request);
> > my $content = $response->as_string();
> >
> > print "$content\n";
> > __END__
> >
> >
> > ###################################################
> >
> > But like I said, you need to be able to watch your transaction with
> > tcpick or ethereal, to see exactly what you need to do. There are
> > many complications, like it may set a cookie.
> >
> >
> >
> > --
> > I'm not really a human, but I play one on earth.
> > http://zentara.net/japh.html
>
> Or you can try Curl.
>
> sub do_curl {
>
>    my $curl = Curl::easy::init();
>
>    if(!$curl) {
>       die "curl init failed!\n";
>    }
>
>    my $url = "enter your url here";
>    my $rawHTML = ""; # stores the return HTML
>
>    $::errbuf = "";
>    Curl::easy::setopt($curl, CURLOPT_ERRORBUFFER, "::errbuf");
>
>    Curl::easy::setopt($curl, CURLOPT_URL, $url);
>    Curl::easy::setopt($curl, CURLOPT_NOPROGRESS, 1);
>    Curl::easy::setopt($curl, CURLOPT_TIMEOUT, 30);
>    Curl::easy::setopt($curl, CURLOPT_HEADERFUNCTION, \&header_callb);
>    Curl::easy::setopt($curl, CURLOPT_WRITEFUNCTION, \&body_callb);
>    Curl::easy::setopt($curl, CURLOPT_POST, 1);
>    Curl::easy::setopt($curl,
> CURLOPT_POSTFIELDS,"username=xyz&password=xyz");
>    Curl::easy::setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
>    Curl::easy::setopt($curl, CURLOPT_SSL_VERIFYHOST, 1);
>    Curl::easy::setopt($curl, CURLOPT_USERAGENT, "Mozilla/4.0");
>    Curl::easy::perform($curl);
>    Curl::easy::cleanup($curl);
>
> }
>
> # Used with cURL; stores the raw HTML retrieved
>
> sub body_callb {
>    my($chunk,$handle)=@_;
>    ${handle} .= $chunk;
>    $rawHTML .= $chunk;
>    return length($chunk);
>
> }
>
> # Used with cURL; gets header for debugging purposes.
>
> sub header_callb {
>    return length($_[0]);
>
> }
>
> If it sets a cookie, Curl can handle that too, but it gets more
> complicated. It's hard for us to give you an accurate script without
> having a valid logon and a way to test.



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

Date: 25 Oct 2006 04:40:31 -0700
From: "Chendu" <pjsenthil@gmail.com>
Subject: Control Modelsim simulation from Perl Script
Message-Id: <1161776431.063112.64370@k70g2000cwa.googlegroups.com>

Hi

I want to control the modelsim Simulation using Perl script.

Can any one give idea how to go about it.

i know that ..We have  to call the the commans of model sim in perl
VSIM to load.

but how to make my script get connected top the instance on the
modelsim window.


Thanks 

Regards
Senthil



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

Date: 25 Oct 2006 11:38:01 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: help needed
Message-Id: <0sbuj258frl1cc2jtetkge4lefokieoeii@4ax.com>

On 24 Oct 2006 20:26:55 -0700, "novostik@googlemail.com"
<novostik@googlemail.com> wrote:

>Subject: help needed

Me too! So what? How 'bout putting the subject of your post in the
Subject?!?

>hi guys ,

hi dude,

>             i m new to perl.i want to know how perl programming is

i m not new to perl.

>done to extract links etc from html pages using HTML:linkextor ,
>LWP:useragent etc......so could u please provide me some links  from

No such things as HTML:linkextor or LWP:useragent. But perhaps you
want to read

  perldoc HTML::LinkExtor
  perldoc LWP::UserAgent

>where i can start.

From the above. Of course some basic introductory book about Perl
would be quite useful as well.

>It would be of great help.

Hope so.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: 25 Oct 2006 11:38:57 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: help needed
Message-Id: <r4cuj25l5l71c451uf75aro5gflkuv3kdk@4ax.com>

On 24 Oct 2006 22:15:10 -0700, usenet@DavidFilmer.com wrote:

>Hmmm. I first thought, "you gotta be kidding me" but then I noticed
>that you only use one colon (doublepoint) in the module names, and that

And also wrong capitalization, BTW.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Tue, 24 Oct 2006 23:13:49 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: help needed
Message-Id: <slrnejtp3t.alv.tadmc@tadmc30.august.net>

novostik@googlemail.com <novostik@googlemail.com> wrote:

> Subject: help needed


Subject needed.


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


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

Date: Wed, 25 Oct 2006 12:41:53 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: hexdump (was: Re: What's wrong)
Message-Id: <ehnmbq.qs.1@news.isolution.nl>

Joe Smith schreef:

> print "Before: ",(unpack "H*",$_),"\n";

To get the bytes separated, one can do

  { local ($\, $,) = ("\n", '.') ;
    print "Before: ", unpack('(H2)*', $_) ;
  }

-- 
Affijn, Ruud

"Gewoon is een tijger."


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

Date: 25 Oct 2006 09:38:09 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: How can i find source code like Data::Dumper in perl package
Message-Id: <4q8pk1Flpk1fU1@news.dfncis.de>

Tad McClellan  <tadmc@augustmail.com> wrote in comp.lang.perl.misc:
> anno4000@radom.zrz.tu-berlin.de <anno4000@radom.zrz.tu-berlin.de> wrote:
> > <jagon.cn@gmail.com> wrote in comp.lang.perl.misc:
> >> i am running on linux box and i am trying to find the module source
> >> code of Data::Dumper from my perl lib /usr/lib/perl5, but i can not get
> >> it.
> >> 
> >> Is there anyone who can tell me how to find it on my machine or
> >> actually it does not exist. I also can not find Net::SSLeay.
> >
> > This is what I use:
> >
> >     #!/usr/local/bin/perl
> >     use strict; use warnings; $| = 1;
> >
> >     for ( shift ) {
> >         s/(?<!\.pm)$/.pm/;
> >         s{::}{/}g;
> >         require;
> >         $INC{ $_} or die "Can't find module '$_' in \%INC";
> >         exec '/usr/bin/view', $INC{ $_};
> >     }
> 
> 
> This is what I use:
> 
>    perldoc -l Data::Dumper

That shows the location of the module.  "perldoc -m ..." shows the
source text.  That option didn't exist when I wrote the little ditty
above.

Anno


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

Date: 25 Oct 2006 09:45:32 GMT
From: Dave Weaver <zen13097@zen.co.uk>
Subject: Re: I have no problems eating cereal...after it softens. Why is replacing a simple string so hard then?
Message-Id: <453f323c$0$2441$db0fefd9@news.zen.co.uk>

On 24 Oct 2006 05:26:19 -0700, Brian  Wilkins <bwilkins@gmail.com> wrote:
> 
>  Dave Weaver wrote:
> > On 17 Oct 2006 16:48:18 -0700, Brian  Wilkins <bwilkins@gmail.com> wrote:
> > >
> > >  use strict;
> > >  use warnings;
> > >  use HTML::TokeParser;
> > >
> > >  $data_file="webpage.htm";
> >
> > That doesn't compile. You "use strict" but then you don't
> > declare your variables
> >
---[ snip code criticism ]---

> 
>  All your comments are OBE as I explained that HTML::TokeParser works
>  better and the code was written off the cuff.

OBE? I have no idea what that means.

You posted code that didn't compile, was of generally poor quality,
and wasn't even marked as "untested". I merely commented on it.

If my comments don't help you, then perhaps someone else will be
enlightened.



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

Date: 25 Oct 2006 03:09:29 -0700
From: "Brian  Wilkins" <bwilkins@gmail.com>
Subject: Re: I have no problems eating cereal...after it softens. Why is replacing a simple string so hard then?
Message-Id: <1161770969.752097.140340@i3g2000cwc.googlegroups.com>


Dave Weaver wrote:
> On 24 Oct 2006 05:26:19 -0700, Brian  Wilkins <bwilkins@gmail.com> wrote:
> >
> >  Dave Weaver wrote:
> > > On 17 Oct 2006 16:48:18 -0700, Brian  Wilkins <bwilkins@gmail.com> wrote:
> > > >
> > > >  use strict;
> > > >  use warnings;
> > > >  use HTML::TokeParser;
> > > >
> > > >  $data_file="webpage.htm";
> > >
> > > That doesn't compile. You "use strict" but then you don't
> > > declare your variables
> > >
> ---[ snip code criticism ]---
>
> >
> >  All your comments are OBE as I explained that HTML::TokeParser works
> >  better and the code was written off the cuff.
>
> OBE? I have no idea what that means.
>
> You posted code that didn't compile, was of generally poor quality,
> and wasn't even marked as "untested". I merely commented on it.
>
> If my comments don't help you, then perhaps someone else will be
> enlightened.

OBE = Overcome By Events.

And yes it was stated untested. I guess you were too busy sitting on
your high horse to notice this line:

"Like so (caution not tested): " But hey, we can't all be perfect like
you, right? I never intended for it to work completely, just be an
example. If he had more questions (which he did offline), then I would
of answered them. Get over yourself dude.



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

Date: 25 Oct 2006 12:57:25 GMT
From: Dave Weaver <zen13097@zen.co.uk>
Subject: Re: I have no problems eating cereal...after it softens. Why is replacing a simple string so hard then?
Message-Id: <453f5f35$0$2438$db0fefd9@news.zen.co.uk>

On 25 Oct 2006 03:09:29 -0700, Brian  Wilkins <bwilkins@gmail.com> wrote:
>  OBE = Overcome By Events.
> 
>  And yes it was stated untested. I guess you were too busy sitting on
>  your high horse to notice this line:
> 
>  "Like so (caution not tested): "

I missed that statement, and I hereby apologise for that, but there is
no need for you to resort to personal comments ("high horse", "get
over yourself"...).

I merely commented on posted code. If you don't want comments, don't
post code. 

If code that is posted in a public forum such as this has problems, it
is good for those problems to be pointed out in the same public forum
so that people who don't know Perl so well can won't be mislead into
thinking it's perfectly acceptable code, and then go and use it
themselves.

> But hey, we can't all be perfect like you, right?

I never claimed I or my code was perfect. In fact I'd love you (or
anyone else) to comment on my code and point out problems with it.
This is how the learning process works.

This is now way OT.


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

Date: Wed, 25 Oct 2006 00:22:19 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: LWP and Javascript -- Not The Same Old Question
Message-Id: <MoGdnaq_VeJ3jaLYnZ2dnUVZ_radnZ2d@comcast.com>

EdwardATeller wrote:
> the page with Firefox with javascript turned off, the important info is
> right there on my screen, although a litle garbled.  I'm guessing the
> page detects javascript and serves accordingly.

No, the page does not do the detecting.

 From your description, there is no proof that the web server is
doing anything different with javascript is turned off in the browser.

What you're seeing is what happens when the browser comes across
a page with javascript in it.  This includes static pages on the
local hard disk where there is no server involved.

Javascript on: Firefox parses the javascript program and does what it
says.  Javascript off: Firefox does not recognize the javascript as
being a program; treats it as plain text.

> Here is my thought.  Can I create a useragent that grabs pages after
> telling the webserver it doesn't support javascript?

The useragent does not tell the web server that it does or does not
support javascript.  It sends an "agent" string that typically
includes the browser's version number.

If you come across a server that sends one set of javascript code
when accessed by MSIE and a different set of javascript code when
accessed by Netscape, then you may need to adjust $ua->agent("...").

Otherwise, just don't do anything special, and you will get the
javascript.

	-Joe


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

Date: Wed, 25 Oct 2006 14:41:52 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: multiline
Message-Id: <ehnt6d.1os.1@news.isolution.nl>

hawk.alan@gmail.com schreef:

> open(FILE,$ARGV[0]);
>
> while(<FILE>){
>  if (/falls mainly on.*l /s){ print"1";};
>  print;
> }
>
>
> the rain in spain
> falls mainly on the
> plain
>
> isn't matching across the line. plz help. The /s modifier doesn't seem
> to be working.

#!/usr/bin/perl -T
  use strict ;
  use warnings ;

  my $fn = $ARGV[0] ;
  open my $fh, '<', $fn  or  die "<$fn> $!" ;

  { # paragraph-mode
    local $/ = '' ;

    while (<$fh>)
    {
      /falls mainly on.*l/s and print "found one\n" ;
    }
  }

  close $fh  or  die "<$fn> $!" ;

-- 
Affijn, Ruud

"Gewoon is een tijger."



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

Date: 25 Oct 2006 02:01:54 -0700
From: timothy.hill@gmail.com
Subject: Setting permissions on remote directory using Net::SFTP
Message-Id: <1161766914.405053.250150@i3g2000cwc.googlegroups.com>

Hi,

I am in the process of writing a script that puts files on a remote
unix box from a windows machine (I am also using Net::SSH::W32Perl). It
is important that these files are placed in the correct directory and
if that directory does not exist, it must be created with the correct
permissions (777). For this I am using the do_mkdir() function. I am
able to create the directory fine, but I just cannot get the
permissions to set correctly - I have put loads of different numbers
into this, but have been able to get anything but rwxrwxrwx on the
directory. The code I have hacked for this bit is:

         my $attrs = new Net::SFTP::Attributes();
         $attrs->flags(15);
         $attrs->size(4096);
         $attrs->uid($ftp_info{$user}->{'uid'});
         $attrs->gid($ftp_info{$user}->{'gid'});
         $attrs->perm(16895);
         $attrs->atime(time);
         $attrs->mtime(time);

         $sftp->do_mkdir($remote_dir, $attrs);

The 16895 value you see is the mode value I have obtained from doing a
stat on a directory that has the required permissions, but running this
code only produces drwxr-xr-x premissions. This is driving me potty -
can anyone help?

Cheers

Tim



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

Date: 25 Oct 2006 10:31:04 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: string substitution for a file, without replacing partial string?
Message-Id: <oj7uj2ddkm7c4u842gb200rhsjefirofb3@4ax.com>

On 24 Oct 2006 21:05:01 -0700, "gavino" <bootiack@yahoo.com> wrote:

>I did not intend to offend you.  I tried your code and it didn't work.

(You're still posting without quoting some relevant context, *this* is
offensive in the first place.) *How* did you try it? *How* did it fail
to work? Had you included these *relevant* info, it would have been
easier to tell you what *you* were doing wrong. Anno's code was right,
indeed it was the s/// you had been asking for. How to run one-liners
on *NIX shell's and cmd.exe's command line respectively is a whole
another story, and incidentally not really a Perl one.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Tue, 24 Oct 2006 22:01:17 +0200
From: Michael Perle <michael_perle@yahoo.com>
Subject: Re: use of variables
Message-Id: <453e70e5$1_2@news.arcor-ip.de>

news2003@wanadoo.es wrote:
> $a = 10;
> $b = 5;
> 
> print "trail ". $a + $b . "\n";  # why this???
> $perl sample3.pl
> 5

The precedence of the plus might be lower than
the one of the string concatenation? I don't know,
but if so then the first statement would be like

print ("trail " . $a) + ($b . "\n");

where ($b + "\n") results in "5\n".

> If I change the last statement to
> print "trail ". ($a + $b) . "\n";  # why this???

Yes, that seems to confirm that I am right with the above.

MP


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

Date: Wed, 25 Oct 2006 00:46:32 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: Use system to start a server then execute commands on it
Message-Id: <C5adnX9hGO0Ki6LYnZ2dnUVZ_ridnZ2d@comcast.com>

James Fassett wrote:

> The problem is `some cmd` reacts as if the original system call had not
> been made (i.e. as if perforce is not running).  If I run a seperate
> terminal and sleep between the calls I can see that the perforce server
> has been properly started and I can call commands on the server;
> however once the sleep expires `some cmd` still fails.   `some cmd`
> works as expected if the perforce server has been started externally to
> the script (as in subsequent runs)

You'll need to track down exactly when the server quits running.

   system "$P4BIN/p4d -r $P4ROOT -J journal -L err.log &";
   print "Started server\n",grep /p4d/,`ps ax`;
   print "Sleeping; try accessing p4 from another window"; sleep 120;
   print "\nCheck 1 for server still running\n",grep /p4d/,`ps ax`;
   print "Attempting to access server\n";
   $_ = `$P4BIN/p4 edit foo.bar`;
   print "Result = '$_'\n";
   print "Check 2 for server still running\n",grep /p4d/,`ps ax`;
   print "Sleeping; try accessing p4 from another window"; sleep 120;
   print "\nExiting; try accessing p4 now that $0 is done\n";
   exit;

 From your description, it sounds like the server is disappearing
between "Check 1" and "Check 2".
	-Joe


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

Date: 25 Oct 2006 11:30:22 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: using File::Find with big files on Linux
Message-Id: <rgbuj25ic6f3c26vg31esqla846611l7tg@4ax.com>

On Tue, 24 Oct 2006 20:55:50 -0700, Joe Smith <joe@inwap.com> wrote:

>> I've noticed something peculiar with a script that
>> checks file sizes using the File::Find - finddepth
   ^^^^^^^^^^^^^^^^^
   ^^^^^^^^^^^^^^^^^
>> routine.  When it comes across really big files,
>> say >4GB it examines (or compares) the file twice.
>
>I haven't seen that problem.
[snip]
>linux% perl -MFile::Find -le 'finddepth(sub {print $File::Find::name},".")'

Not that I expect it to make a difference, but yours is a flawed
comparison, since you do *not* "checks file sizes"...


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: 25 Oct 2006 11:33:34 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: using File::Find with big files on Linux
Message-Id: <qlbuj21iclbrpadnni2dtje53n4o9ttl68@4ax.com>

On Tue, 24 Oct 2006 16:50:09 -0700, Matt Rohm <rohm@cisco.com> wrote:

>routine.  When it comes across really big files,
>say >4GB it examines (or compares) the file twice.
>
>Anyone seen this before?  Care to share the cause of
>this problem, and some ideas for a solution?

As others said, this sounds strange, and it would be easier to believe
it if you gave some evidence. Wild guess: isn't it that you're doing
multiple stat(s) perhaps in the disguised form of some -X? If so, then
just use the _ filehandle, if possible of course. However this should
affect *all* files independently of their size, but perhaps you were
concerned about "really big files" and only noticed the thing in
connection with them...


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

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


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