[30629] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1874 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 25 03:13:05 2008

Date: Thu, 25 Sep 2008 00:09: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           Thu, 25 Sep 2008     Volume: 11 Number: 1874

Today's topics:
        Can't call method on an undefined value <sun_tong_001@users.sourceforge.net>
    Re: FAQ 1.14 What is a JAPH? <brian.d.foy@gmail.com>
        new CPAN modules on Thu Sep 25 2008 (Randal Schwartz)
    Re: Opening files on the web for reading <tim@burlyhost.com>
    Re: Opening files on the web for reading <ced@blv-sam-01.ca.boeing.com>
    Re: question about "package" and variable scope... <spamtrap@dot-app.org>
    Re: question about "package" and variable scope... <news@chaos-net.de>
    Re: question about "package" and variable scope... <john@castleamber.com>
    Re: question about "package" and variable scope... <hansmu@xs4all.nl>
    Re: question about "package" and variable scope... <tadmc@seesig.invalid>
        Question on opalORB <khan.m.arshad@gmail.com>
    Re: Regular Expressions & replacements <tadmc@seesig.invalid>
        use Class::Std :ATTR <sun_tong_001@users.sourceforge.net>
    Re: use Class::Std :ATTR <sun_tong_001@users.sourceforge.net>
    Re: websites and cookies? <tadmc@seesig.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 25 Sep 2008 01:17:28 -0500
From: * Tong * <sun_tong_001@users.sourceforge.net>
Subject: Can't call method on an undefined value
Message-Id: <N6WdnYcwOY5lsUbVnZ2dnUVZ_uqdnZ2d@golden.net>

Hi, 

I can't figure out how to fix the following code:

$ cat -n oo-test.pl
     1  #!/usr/bin/env perl
     2
     3  package Cow; {
     4      use strict;
     5      use Class::Std;
     6      my %name_of :ATTR(get => 'name', set => 'name');
     7      sub DEMOLISH {
     8          my $self = shift;
     9          print "[" . $self->get_name . " has died.]\n";
    10      }
    11  }
    12
    13  package Barn;
    14  use Class::Std;
    15  my $animals_of;
    16  sub add {
    17      my ($self, $animal) = @_;
    18      $animals_of{ ident $self }
    19          { $animal->get_name } = $animal;
    20  }
    21
    22  package main;
    23  my $barn = Barn->new();
    24  $barn->add(Cow->new()->set_name("Bessie"));
    25

$ oo-test.pl
Can't call method "get_name" on an undefined value at ./oo-test.pl line 
18.

Please help. Thanks

tong


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

Date: Wed, 24 Sep 2008 21:49:30 -0500
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 1.14 What is a JAPH?
Message-Id: <240920082149309086%brian.d.foy@gmail.com>

In article <86ej3a4zyk.fsf@blue.stonehenge.com>, Randal L. Schwartz
<merlyn@stonehenge.com> wrote:

> >>>>> "PerlFAQ" == PerlFAQ Server <brian@stonehenge.com> writes:
> 
> PerlFAQ>             print "Just another Perl hacker, ";
> 
> PerlFAQ>     Note the trailing comma and space, which allows the addition of
> PerlFAQ>     other JAxH clauses for his many other interests.
> 
> Actually, it was just a comma, not a comma and space.  This made it nicely
> 25 chars, which nicely formed a 5x5 grid which I used in at least a few
> of the JAPHs.

fixed, thanks :)


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

Date: Thu, 25 Sep 2008 04:42:24 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Thu Sep 25 2008
Message-Id: <K7qIEo.1os3@zorch.sf-bay.org>

The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN).  You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.

AI-Genetic-Pro-0.19
http://search.cpan.org/~strzelec/AI-Genetic-Pro-0.19/
Efficient genetic algorithms for professional purpose. 
----
AIX-Perfstat-0.04
http://search.cpan.org/~aciddeath/AIX-Perfstat-0.04/
Perl wrapper for perfstat() functions. 
----
Acme-6502-0.72
http://search.cpan.org/~andya/Acme-6502-0.72/
Pure Perl 65C02 simulator. 
----
Acme-6502-0.73
http://search.cpan.org/~andya/Acme-6502-0.73/
Pure Perl 65C02 simulator. 
----
Apache2-LogNotify-0.1
http://search.cpan.org/~rios/Apache2-LogNotify-0.1/
----
App-Bondage-0.3.1
http://search.cpan.org/~hinrik/App-Bondage-0.3.1/
A featureful IRC bouncer based on POE::Component::IRC 
----
App-Bondage-0.3.2
http://search.cpan.org/~hinrik/App-Bondage-0.3.2/
A featureful IRC bouncer based on POE::Component::IRC 
----
Archive-Extract-0.27_02
http://search.cpan.org/~kane/Archive-Extract-0.27_02/
A generic archive extracting mechanism 
----
CHI-0.081
http://search.cpan.org/~jswartz/CHI-0.081/
Unified cache interface 
----
CHI-Driver-Memcached-0.02
http://search.cpan.org/~jswartz/CHI-Driver-Memcached-0.02/
Distributed cache via memcached (memory cache daemon) 
----
CPANPLUS-YACSmoke-0.12
http://search.cpan.org/~bingos/CPANPLUS-YACSmoke-0.12/
Yet Another CPANPLUS Smoke Tester 
----
Catalyst-Helper-AuthDBIC-0.06
http://search.cpan.org/~zarquon/Catalyst-Helper-AuthDBIC-0.06/
(EXPERIMENTAL) 
----
Catalyst-Plugin-Session-Store-DBIC-0.07
http://search.cpan.org/~danieltwc/Catalyst-Plugin-Session-Store-DBIC-0.07/
Store your sessions via DBIx::Class 
----
Catalyst-Plugin-Session-Store-Memcached-Fast-0.01
http://search.cpan.org/~bwizard/Catalyst-Plugin-Session-Store-Memcached-Fast-0.01/
----
Chart-Clicker-2.11
http://search.cpan.org/~gphat/Chart-Clicker-2.11/
Powerful, extensible charting. 
----
DBIx-DataModel-1.04
http://search.cpan.org/~dami/DBIx-DataModel-1.04/
Classes and UML-style Associations on top of DBI 
----
Dynamic-Loader-0.9
http://search.cpan.org/~evaleto/Dynamic-Loader-0.9/
call a script without to know where is his location. 
----
Dynamic-Loader-0.99
http://search.cpan.org/~evaleto/Dynamic-Loader-0.99/
call a script without to know where is his location. 
----
Games-Risk-1.0.3
http://search.cpan.org/~jquelin/Games-Risk-1.0.3/
classical 'risk' board game 
----
Geo-JapanMesh-0.0.1
http://search.cpan.org/~kokogiko/Geo-JapanMesh-0.0.1/
Convert between latitude/longitude and Japanese geographical mesh code 
----
HTTP-Proxy-Builder-0.01
http://search.cpan.org/~book/HTTP-Proxy-Builder-0.01/
Assemble several proxies into a single one. 
----
IO-Socket-INET6-2.55
http://search.cpan.org/~shlomif/IO-Socket-INET6-2.55/
Object interface for AF_INET|AF_INET6 domain sockets 
----
IO-Socket-SSL-1.16_2
http://search.cpan.org/~sullr/IO-Socket-SSL-1.16_2/
Nearly transparent SSL encapsulation for IO::Socket::INET. 
----
IPC-Cmd-0.41_06
http://search.cpan.org/~kane/IPC-Cmd-0.41_06/
finding and running system commands made easy 
----
LEOCHARRE-Class2-1.11
http://search.cpan.org/~leocharre/LEOCHARRE-Class2-1.11/
----
Layout-Manager-0.19
http://search.cpan.org/~gphat/Layout-Manager-0.19/
2D Layout Management 
----
Mojo-0.2
http://search.cpan.org/~sri/Mojo-0.2/
Yeah, Baby, Yeah! 
----
Mojo-0.3
http://search.cpan.org/~sri/Mojo-0.3/
Yeah, Baby, Yeah! 
----
MooseX-Blessed-Reconstruct-0.01
http://search.cpan.org/~nuffin/MooseX-Blessed-Reconstruct-0.01/
A Data::Visitor for creating Moose objects from blessed placeholders 
----
MooseX-Method-Signatures-0.01
http://search.cpan.org/~flora/MooseX-Method-Signatures-0.01/
Method declarations with type constraints and no source filter 
----
MooseX-Method-Signatures-0.02
http://search.cpan.org/~flora/MooseX-Method-Signatures-0.02/
Method declarations with type constraints and no source filter 
----
MooseX-YAML-0.01
http://search.cpan.org/~nuffin/MooseX-YAML-0.01/
DWIM loading of Moose objects from YAML 
----
Mozilla-Mechanize-GUITester-0.16
http://search.cpan.org/~bosu/Mozilla-Mechanize-GUITester-0.16/
enhances Mozilla::Mechanize with GUI testing. 
----
Mozilla-PromptService-0.05
http://search.cpan.org/~bosu/Mozilla-PromptService-0.05/
Perl interface to the Mozilla nsIPromptService 
----
Net-SIP-0.48
http://search.cpan.org/~sullr/Net-SIP-0.48/
Framework SIP (Voice Over IP, RFC3261) 
----
ORLite-0.15
http://search.cpan.org/~adamk/ORLite-0.15/
Extremely light weight SQLite-specific ORM 
----
PAR-Dist-0.34
http://search.cpan.org/~smueller/PAR-Dist-0.34/
Create and manipulate PAR distributions 
----
PDF-OCR2-1.09
http://search.cpan.org/~leocharre/PDF-OCR2-1.09/
extract all text and all image ocr from pdf 
----
POE-Component-IRC-Plugin-MegaHAL-0.11
http://search.cpan.org/~hinrik/POE-Component-IRC-Plugin-MegaHAL-0.11/
A PoCo-IRC plugin which provides access to a MegaHAL conversation simulator. 
----
POE-Component-SmokeBox-Dists-0.06
http://search.cpan.org/~bingos/POE-Component-SmokeBox-Dists-0.06/
Search for CPAN distributions by cpanid or distribution name 
----
Panotools-Script-0.19
http://search.cpan.org/~bpostle/Panotools-Script-0.19/
Panorama Tools scripting 
----
Parse-Apache-ServerStatus-0.06
http://search.cpan.org/~bloonix/Parse-Apache-ServerStatus-0.06/
Simple module to parse apache's server-status. 
----
SVN-Notify-2.78
http://search.cpan.org/~dwheeler/SVN-Notify-2.78/
Subversion activity notification 
----
Sub-Auto-0.02
http://search.cpan.org/~osfameron/Sub-Auto-0.02/
declare individual handlers for AUTLOADed subs, respecting can and inheritance 
----
Sub-Auto-0.0201
http://search.cpan.org/~osfameron/Sub-Auto-0.0201/
declare individual handlers for AUTLOADed subs, respecting can and inheritance 
----
Sub-Curried-0.06
http://search.cpan.org/~osfameron/Sub-Curried-0.06/
Currying of subroutines via a new 'curry' declarator 
----
Sys-Statistics-Linux-0.40
http://search.cpan.org/~bloonix/Sys-Statistics-Linux-0.40/
Front-end module to collect system statistics 
----
Tie-Array-QueueExpire-0.55
http://search.cpan.org/~fdulau/Tie-Array-QueueExpire-0.55/
----
Tk-StyleDialog-0.04
http://search.cpan.org/~kirsle/Tk-StyleDialog-0.04/
Stylish dialog boxes with custom icons. 
----
WWW-Comic-Plugin-XKCD-0.02
http://search.cpan.org/~bigpresh/WWW-Comic-Plugin-XKCD-0.02/
WWW::Comic plugin to fetch XKCD comic 
----
WWW-WhitePages-2008.0924
http://search.cpan.org/~ermeyers/WWW-WhitePages-2008.0924/
WhitePages Development Interface (WPDI) 
----
WebService-Hatena-Diary-0.01
http://search.cpan.org/~hakobe/WebService-Hatena-Diary-0.01/
A Perl Interface for Hatena::Diary AtomPub API 
----
libwww-perl-5.815
http://search.cpan.org/~gaas/libwww-perl-5.815/


If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.

This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
  http://www.stonehenge.com/merlyn/LinuxMag/col82.html

print "Just another Perl hacker," # the original

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


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

Date: Wed, 24 Sep 2008 13:34:16 -0700
From: Tim Greer <tim@burlyhost.com>
Subject: Re: Opening files on the web for reading
Message-Id: <cvxCk.55827$QF5.25067@newsfe08.iad>

Graham Stow wrote:

> Can anyone give me some Perl code to open an html file on the web
> (i.e. an html file stored on somebody elses web server and not mine),
> for reading. Or is it more complicated than that?

Are you just looking to read it and maybe check something, or parse it,
or download it/save it?  There are many methods, but the best one could
depend on what your goals are.
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Wed, 24 Sep 2008 21:44:20 -0700 (PDT)
From: "C.DeRykus" <ced@blv-sam-01.ca.boeing.com>
Subject: Re: Opening files on the web for reading
Message-Id: <ff8a1bf4-643a-47e7-958c-0c05db4595af@w39g2000prb.googlegroups.com>

On Sep 24, 8:47 am, xhos...@gmail.com wrote:
> ...
>
> LWP::UserAgent using a callback with for example :content_cb would "stream"
> the data back, but not via a file handle.  One could probably come up with
> an adaptor that ties a file handle front end to the callback backend.
>
> There might be a more direct way, but I don't know what it is.
>
S
Another possibility  but still indirect
(and w/o graceful error handling):

use LWP::Simple;
my $pid = open( my $fh, "-|" );
die "fork: $!" unless defined $pid;
if ($pid ) { while <$fh> { ... }  }
      else { getprint( ...); }
 ...



--
Charles DeRykus


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

Date: Wed, 24 Sep 2008 16:10:53 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: question about "package" and variable scope...
Message-Id: <m1myhx1f02.fsf@dot-app.org>

Martin Kißner <news@chaos-net.de> writes:

> 'perldoc Exporter' explains how to use Exporter in modules (I didn't
> read it thoroughly yet).
> Is it also possible to use it in the main script to make variables
> declared in the main script accessible inside the module?

Not that I know of, and for good reason. Modules should be self-
contained, with as little knowledge as possible of anything outside of
their own package. If the main program needs to provide some variable
to the module, it should either set a variable in the module's
package, or pass it to a function (or method) that the module
supplies.

For example, when you're using the CGI.pm module, you use a variable
in the module's name space ($CGI::POST_MAX) to set the maximum amount
of data that will be accepted from a form.

sherm--

-- 
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Wed, 24 Sep 2008 23:08:36 +0200
From: Martin =?UTF-8?Q?Ki=C3=9Fner?= <news@chaos-net.de>
Subject: Re: question about "package" and variable scope...
Message-Id: <slrngdlb2m.49m.news@maki.homeunix.net>

Sherm Pendley wrote :
> [...] If the main program needs to provide some variable
> to the module, it should either set a variable in the module's
> package, or pass it to a function (or method) that the module
> supplies.

This is how I do it right now.
Actually I am talking about a script and a couple of selfmade modules
which I use to build a multilingual website with a MySQL database in the
background. I also use HTML::Template.

My modules need access to the server variables and some other global
information.
For the sake of shortness and readability I declared some variables in
the main script for this purpose like:

my $language = de; # or en or nl ...
my $uri = $ENV{REQUEST_URI};
my $docroot = $ENV{DOCUMENT_ROOT};
 ...

Since these variables never change during one run of the script I
thought there must be an easier way to pass them to functions/methods
inside the modules than always passing them with every call of one of
those functions/methods. $main::uri will do but there might be another
option.

> For example, when you're using the CGI.pm module, you use a variable
> in the module's name space ($CGI::POST_MAX) to set the maximum amount
> of data that will be accepted from a form.

I didn't consider this possibility until now. This might be helpful in
other situations but if I load different modules depending on conditions
I think this might not be very comfortable.

Thank you for your help
regards
Martin

-- 
perl -e '$S=[[73,116,114,115,31,96],[108,109,114,102,99,112],
[29,77,98,111,105,29],[100,93,95,103,97,110]];
for(0..3){for$s(0..5){print(chr($S->[$_]->[$s]+$_+1))}}'


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

Date: 24 Sep 2008 21:23:24 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: question about "package" and variable scope...
Message-Id: <Xns9B23A6BA9B2A2castleamber@130.133.1.4>

Martin =?UTF-8?Q?Ki=C3=9Fner?= <news@chaos-net.de> wrote:

> my $language = de; # or en or nl ...
> my $uri = $ENV{REQUEST_URI};
> my $docroot = $ENV{DOCUMENT_ROOT};

my $settings = {

    	language => ...
    	uri      => ...
    	docroot  => ...
};

You might want to create a module Settings with a get class method that 
just returns that.

-- 
John    http://johnbokma.com/ - Hacking & Hiking in Mexico

Perl help in exchange for a gift:
http://johnbokma.com/perl/help-in-exchange-for-a-gift.html


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

Date: Thu, 25 Sep 2008 00:40:45 +0200
From: Hans Mulder <hansmu@xs4all.nl>
Subject: Re: question about "package" and variable scope...
Message-Id: <48dac297$0$183$e4fe514c@news.xs4all.nl>

Martin Kißner wrote:

> $main::uri will do but there might be another option.

You could spell $main::uri as $::uri

That way, you can still tell at a glance which variables are
global, and this notation is hardly longer than normal variables.

Hope this helps,

-- HansM


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

Date: Wed, 24 Sep 2008 19:39:07 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: question about "package" and variable scope...
Message-Id: <slrngdlndb.q37.tadmc@tadmc30.sbcglobal.net>

Martin Kißner <news@chaos-net.de> wrote:
> Tad J McClellan wrote :
>> Raymundo <gypark@gmail.com> wrote:
>>
>>> Ooops.. I couldn't even imagine that "our" and "use vars" have
>>> different scope rule...
>>
>>
>> Simply read their documentation...
>>
>>     perldoc -f our
>>
>>         ... within the lexical scope of the C<our> declaration ...
>
> I wasn't aware that the lexical scope is restricted to the file.
> Thanks to sherm I am now.


Another resource that would have revealed the "restricted to file"
scope of lexical variables would be

   "Coping with Scoping":

      http://perl.plover.com/FAQs/Namespaces.html


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Wed, 24 Sep 2008 19:39:23 -0700 (PDT)
From: mak <khan.m.arshad@gmail.com>
Subject: Question on opalORB
Message-Id: <4f2dba16-1729-40ac-8336-06b2f434f440@s20g2000prd.googlegroups.com>

Hi All,

Sorry for posting a question not entirely related to Perl.

I need to know if there are any guidelines on using a CORBA client
written in Perl, uses opalORB (version 0.1.4) and runs inside Apache
mod_perl (Linux, FC6).?

I am facing some problems when the server to which the client is
communicating goes down and comes back again later. The server is
written in C++ and uses TAO and is running on the same machine as
client. While the server is down, any attempt to connect generates a
TRANSIENT exception at client. After the server is restarted, the
client can re-connect but even after reconnecting successfully,
sometimes it throws a TRANSIENT exception (minor code 2: no usable
profile in IOR). The server object is persistent object running on a
fixed port. Client uses corbaloc url to initiate communication with
the server. The only way to get rid of intermittent TRANSIENT
exceptions is to restart the web server.

Any help is highly appreciated.

Thanks
Arshad


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

Date: Wed, 24 Sep 2008 20:35:05 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Regular Expressions & replacements
Message-Id: <slrngdlqm9.q37.tadmc@tadmc30.sbcglobal.net>

jhgaylor <jhgaylor@gmail.com> wrote:


I thought I might make a try at answering your question when I
saw it on comp.lang.perl.moderated, but gave up due to all of
the unclearness and contradictions your question contained.

You should consider reading the Posting Guidelines that are posted
here frequently to learn how to help us help you.


> So, I am working on a program to take a list of First and Last names
> exported from Novell Groupwise 


Helping with regular expressions requires _exact_ knowledge of
the string being matched against.

What does a list of first and last names exported from Novell Groupwise
look like?

Do you have two-word names in there like "el Habib" or "Billy Bob"?


> and making the list become Last, First,
> firstfourlettersofLastName, password ||
>
> The script I am using is this
>
> #!"\xampplite\perl\bin\perl.exe"
> use CGI qw/:standard/;


You should try and make a short and complete program that we can
run that illustrates your problem.

Your problem is not related to programming in a CGI environment
so you could have stripped that out.


> use overload;


What is it that you are overloading?

Nothing, as far as I can tell. So that isn't germane to your problem either.


> $| = 1;
> $q = new CGI;
> print $q->header();


None of that applies to the problem you are having either...


> local $/=undef;
> open FILE, "users.list" or die "Couldn't open file: $!";


What does the contents of users.list look like?

If you had used a __DATA__ section, as mentioned in the guidelines,
then everybody would know what your data looked like.


> binmode FILE;
> $string = <FILE>;
> close FILE;
>
> $_ = $string;
> chomp($_);


If you want the string in $_, then why read it into some other
variable first? Just read it into the variable that you really
want the data in:

   $_ = <DATA>;


> #Removes some of the formatting
> s/Cof....Members//g;
> s/To:\s//g;
       ^^

Note that you are removing the space character...


> s/Bc:.*\s//g;
> #Checks if the expression will replace anything


There is no need to check if the expression will replace anything.

s/// replaces only things that match. If it does not match, it will
not replace anything.


> if(m/ {1}\w.+\w\b.\w.+\w {1}/g){print "Hello";}
        ^^^                ^^^
                      
The {1} does not change anything, so it should not be included
in the pattern.


> #Finds all names and replaces them with ___
> s/ {1}\w.+\w\b.\w.+\w {1}/___/g;
    ^^^^

Your pattern requires a space character, but it has been stripped away, so
the s/// will not match and will not do anything...


> open (OUT,">>usersFinal.list") || die;
> print OUT $_;
> close OUT;
>
> The line I am having problems with is
> s/ {1}\w.+\w\b.\w.+\w {1}/___/g;
> The line is supposed to find all the names and remove them.  It does
> that, 


How does it match a space character that no longer exists?

Are we looking at the same code that you have executed?


> but replaces all the names with one instance of ___ instead of
> ___ for each name on the list.  


It does not replace anything.

If you have code that replaces something, then it is not the same
code that you are showing to us...


> I can not break the names up by
> looking for \n or \r.  I am not sure why, but I think that they got
> stripped


They did not get stripped.

There must be some other reason that what you tried isn't working,
but we cannot tell because we have not seen what you tried (the
code that successfully puts in ___) nor have we seen the format
of the data that is being processed.


> Eventually I want to add to the end of the name some other
> information, but for now I just need to find the expression that finds
> the names.
>
> Below is an example of the starting information.
>
> Cof2001Members
> To: LastName1, FirstName1
> To: LastName2, FirstName2
> To: LastName3, FirstName3
> To: LastName4, FirstName4
> Bc: Zzip
>
> Here is the way I want to eventually make the information look
>
> Cof2001Members
> Smith, Bob, smit001,
> Jones, John, jone001,
> Green, Jane, gree001,
> Henry, Chris, henr001,


How do you know that "LastName1" maps to "Smith"?

When I tried to write a program to give you, every output line
ended with "last001"...


> Either the expression to match the names 


We will need to see the names in order to help with that.


> and/or the code to add to the
> end of names the needed information would be wonderful.  Thanks
> everyone.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Thu, 25 Sep 2008 00:53:29 -0500
From: * Tong * <sun_tong_001@users.sourceforge.net>
Subject: use Class::Std :ATTR
Message-Id: <VLydnSudKa_EukbVnZ2dnUVZ_rPinZ2d@golden.net>

Hi, 

How can I fix the following code?

$ cat -n oo-test.pl
     1  #!/usr/bin/env perl
     2
     3  package Cow; {
     4      use strict;
     5      use Class::Std;
     6      my %name_of :ATTR(get<name>, set<name>);
     7      sub DEMOLISH {
     8          my $self = shift;
     9          print "[" . $self->get_name . " has died.]\n";
    10      }
    11  }
    12
    13  package main;
    14  my $cow = Cow->new()->set_name("Bessie");

$ oo-test.pl
Can't locate object method "set_name" via package "Cow" at ./oo-test.pl 
line 14

I thought using "my %name_of :ATTR(get<name>, set<name>)" would define 
Cow->set_name for me automatically, wouldn't it?

thanks. 

tong


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

Date: Thu, 25 Sep 2008 01:01:45 -0500
From: * Tong * <sun_tong_001@users.sourceforge.net>
Subject: Re: use Class::Std :ATTR
Message-Id: <N6WdnYQwOY7UtEbVnZ2dnUVZ_uqdnZ2d@golden.net>

On Thu, 25 Sep 2008 00:53:29 -0500, * Tong * wrote:

> I thought using "my %name_of :ATTR(get<name>, set<name>)" would define
> Cow->set_name for me automatically, wouldn't it?

Right way:

    my %name_of :ATTR(get => 'name', set => 'name');


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

Date: Wed, 24 Sep 2008 20:39:16 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: websites and cookies?
Message-Id: <slrngdlqu4.q37.tadmc@tadmc30.sbcglobal.net>

Tomasz Chmielewski <tch@nospam.wpkg.org> wrote:
> I have a webmail which is protected by a "user/password" form (one which 
> you can find in any webmail, i.e. squirrelmail, yahoo/google mail etc.).
>
> The webmail is the only way to fetch mail; there is no POP3/IMAP there.
>
>
> Therefore, I'd like to write a Perl script which will "log in" to that 
> page automatically, parse certain pages (inbox, new mail, save it as 
> files etc.).
>
> As far as I understand, I need to "emulate" a webbrowser a bit:


You can use the Web Scraping Proxy to write Perl code that
emulates a browser. Google for "Web Scraping Proxy".


> 1) log in to a website (fill proper form fields, send it to the web server)
> 2) get the cookie, browse other pages using that cookie
>
>
> What do I need to implement it in a Perl script?


WWW::Mechanize (or LWP::UserAgent).


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

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 V11 Issue 1874
***************************************


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