[21975] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4197 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 29 06:05:43 2002

Date: Fri, 29 Nov 2002 03:05:07 -0800 (PST)
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, 29 Nov 2002     Volume: 10 Number: 4197

Today's topics:
    Re: Another CGI.pm table question (Sunder Chakravaty)
    Re: Apply a formula <jurgenex@hotmail.com>
    Re: Automatic mail (send) with attachments using Perl <s.patterson@freeuk.com>
    Re: C to perl, very large data files, efficiency, idiom (Helgi Briem)
    Re: checking script for perl version compliance <jurgenex@hotmail.com>
        Emacs modules for Perl programming (Jari Aalto+mail.perl)
        Help with perldoc, please. <spikey-wan@bigfoot.com>
    Re: Help with perldoc, please. (Helgi Briem)
        HELP! Looking for a cgi <jmesam@NOSPAMnospam.terra.es>
    Re: HELP! Looking for a cgi <cingram@pjocsNOSPAMORHAM.demon.co.uk>
    Re: Indenting with Data::Dumper::Dump() <cingram@pjocsNOSPAMORHAM.demon.co.uk>
    Re: Learning Perl 3rd Edition Chapter 8 ex3. <bernard.el-hagin@DODGE_THISlido-tech.net>
    Re: Learning Perl 3rd Edition Chapter 8 ex3. <mark@lismark.org>
    Re: New user problem with installing mods <simon.andrews@bbsrc.ac.uk>
    Re: Regular expression question (Villy Kruse)
    Re: Regular expression question <uri@stemsystems.com>
    Re: Regular expression question <bart.lateur@pandora.be>
    Re: Teaching Perl complex data structures <derek@wedgetail.com>
    Re: Teaching Perl complex data structures <bart.lateur@pandora.be>
    Re: trigger internal iis 5.0 services <clandos@web.de>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 28 Nov 2002 22:44:33 -0800
From: sunderc@yahoo.com (Sunder Chakravaty)
Subject: Re: Another CGI.pm table question
Message-Id: <a4d3bd1.0211282244.773dc6b5@posting.google.com>

Art Werschulz <agw@cs.columbia.edu> wrote in message news:<yla8yzd7kdc.fsf@smolyak.cs.columbia.edu>...
> Hi.
> 
> What's the proper way of printing
>    <td align='right'>$foo</td>
> using CGI.pm?  I tried
>    $cgi->td(-align=>'right', $foo)
> and 
>    $cgi->td({-align=>'right'}, $foo),
     $cgi->td({-align=>'right'}, '$foo'); # this should work
> but neither worked.  
> 
> Thanks.


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

Date: Fri, 29 Nov 2002 06:38:46 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Apply a formula
Message-Id: <WXDF9.1259$ic6.682@nwrddc01.gnilink.net>

Sébastien Cottalorda wrote:
> Jürgen Exner wrote:
>> Are you looking for 'eval'?
>
> Maybe ... I have never used that command since then.
>
> How to use it?

Which part of the man page (perldoc -f eval) is unclear to you and needs
further explanation?

jue




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

Date: Fri, 29 Nov 2002 08:44:14 -0800
From: Stephen Patterson <s.patterson@freeuk.com>
Subject: Re: Automatic mail (send) with attachments using Perl
Message-Id: <3DE7995E.9080902@freeuk.com>

Joe Moore wrote:
> I need to create reports and send them on a regular basis.  I don't
> like to do boring things, so I have been working on automating the
> process.  I tried to use Outlook to send my mail, but I received a
> warning that Outlook thinks I might be a virus, and it requires me to
> click.

The simplest way (if you're just trying to email files) is to use 
Mail::Sender

my $sender = Mail::Sender->new(smtp => $mailserver,
			       from => $mailfrom);
$sender->MailFile( {to => $mailto,
		    subject => 'Daily report file',
		    file => $outfile} );



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

Date: Fri, 29 Nov 2002 09:03:34 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: C to perl, very large data files, efficiency, idioms.
Message-Id: <3de64ba2.3765166162@news.cis.dfn.de>

On 28 Nov 2002 08:47:02 -0800, fumail@freeuk.com (qanda)
wrote:
>The first issue for me is size of files and how to read them, there
>could be 1 to 5000 data files to read every day (new files daily),
>each containing 1 to 500000 records resulting in filesizes from 1Kb to
>just over 1GB, so assuming we don't have enough memory we can't (or
>wouldn't want to) read in the whole file.
>
>What options are there for this type of processing, by that I mean
>perlisms for this kind of processing?

Learn to use perldoc, the program that comes with 
Perl for reading its copious and excellent documentation.
'perldoc perldoc' on the command line will get you
started.

The most common way to go through a big file is using
a while loop.  Look into the seek function ( perldoc -f 
seek) if you sometimes need to backtrack.

Here is some example code to get you started, 
a sort of pseudo search engine [untested]

#!perl

use warnings;
use strict;

my $usage = "Usage: $0 pattern file\n";
die $usage if not $ARGV[1];
my ($pattern,$file) = @ARGV;

open IN, $file or die "Cannot open $file\n";
while (<IN>)
{
	print if /$pattern/;
}
close IN;
__END__
-- 
Regards, Helgi Briem
helgi AT decode DOT is

                           A: Top posting
                           Q: What is the most irritating thing on Usenet?
                                           - "Gordon" on apihna


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

Date: Fri, 29 Nov 2002 06:43:36 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: checking script for perl version compliance
Message-Id: <s0EF9.1262$ic6.160@nwrddc01.gnilink.net>

John W. Krahn wrote:
> qanda wrote:
>> is there a tool that can be used to check what versions of perl a
>> perl script will work correctly with?
>>
>> For example if I wrote script.pl I'd like to run something like pvchk
>> script.pl
>> and be told that the earliest version the script would work safely
>> with is n.n.
>
> perldoc -f require

Actually no. 'require' needs to be added by the developer and it specifies
which version of Perl the developer thinks this Perl script would need.

I think what anonymous is looking for is a tool, that would look at a Perl
script and then tell you 'To run this Perl script you need version 5.0 or
later'.

I do not think that such a script can possibly exist because sometimes
functions change their semantics between versions (due to bug fixes or
whatever). And there is no way for a tool to guess which semantic was
intended.

jue




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

Date: 29 Nov 2002 09:56:15 GMT
From: <jari.aalto@poboxes.com> (Jari Aalto+mail.perl)
Subject: Emacs modules for Perl programming
Message-Id: <perl-faq/emacs-lisp-modules_1038563702@rtfm.mit.edu>

Archive-name: perl-faq/emacs-lisp-modules
Posting-Frequency: 2 times a month
URL: http://tiny-tools.sourceforge.net/
Maintainer: Jari Aalto <jari.aalto@poboxes.com>

Announcement: "What Emacs lisp modules can help with programming Perl"

    Preface

        Emacs is your friend if you have to do anything comcerning software
        development: It offers plug-in modules, written in Emacs lisp
        (elisp) language, that makes all your programmings wishes come
        true. Please introduce yourself to Emacs and your programming era
        will get a new light.

    Where to find Emacs/XEmacs

        o   Unix:
            http://www.gnu.org/software/emacs/emacs.html
            http://www.xemacs.org/

        o   Unix Windows port (for Unix die-hards):
            install http://www.cygwin.com/  which includes native Emacs 21.x.
            XEmacs port is bundled in XEmacs setup.exe available from
            XEmacs site.

        o   Pure Native Windows port
            http://www.gnu.org/software/emacs/windows/ntemacs.html
            ftp://ftp.xemacs.org/pub/xemacs/windows/setup.exe

        o   More Emacs resources at
            http://tiny-tools.sourceforge.net/  => Emacs resource page

Emacs Perl Modules

    Cperl -- Perl programming mode

        ftp://ftp.math.ohio-state.edu/pub/users/ilya/perl
        http://www.perl.com/CPAN-local/misc/emacs/cperl-mode/
        <ilya@math.ohio-state.edu>    Ilya Zakharevich

        CPerl is major mode for editing perl files. Forget the default
        `perl-mode' that comes with Emacs, this is much better. Comes
        standard in newest Emacs.

    TinyPerl -- Perl related utilities

        http://tiny-tools.sourceforge.net/

        If you ever wonder how to deal with Perl POD pages or how to find
        documentation from all perl manpages, this package is for you.
        Couple of keystrokes and all the documentaion is in your hands.

        o   Instant function help: See documentation of `shift', `pop'...
        o   Show Perl manual pages in *pod* buffer
        o   Grep through all Perl manpages (.pod)
        o   Follow POD references e.g. [perlre] to next pod with RETURN
        o   Coloured pod pages with `font-lock'
        o   Separate `tiperl-pod-view-mode' for jumping topics and pages
            forward and backward in *pod* buffer.

        o   Update `$VERSION' variable with YYYY.MMDD on save.
        o   Load source code into Emacs, like Devel::DProf.pm
        o   Prepare script (version numbering) and Upload it to PAUSE
        o   Generate autoload STUBS (Devel::SelfStubber) for you
            Perl Module (.pm)

    TinyIgrep -- Perl Code browsing and easy grepping

        [TinyIgrep is included in Tiny Tools Kit]

        To grep from all installed Perl modules, define database to
        TinyIgrep. There is example file emacs-rc-tinyigrep.el that shows
        how to set up dattabases for Perl5, Perl4 whatever you have
        installed

        TinyIgrep calls Igrep.el to to do the search, You can adjust
        recursive grep options, set search case sensitivity, add user grep
        options etc.

        You can find latest `igrep.el' module at
        <http://groups.google.com/groups?group=gnu.emacs.sources> The
        maintainer is Jefin Rodgers <kevinr@ihs.com>.

    TinyCompile -- To Browse grep results in Emacs *compile* buffer

        TinyCompile is a minor mode for *compile* buffer from where
        you can collapse unwanted lines or shorten file URLs:

            /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file1:NNN: MATCHED TEXT
            /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file2:NNN: MATCHED TEXT

            -->

            cd /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/
            file1:NNN: MATCHED TEXT
            file1:NNN: MATCHED TEXT

End



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

Date: Fri, 29 Nov 2002 09:47:18 -0000
From: "Richard S Beckett" <spikey-wan@bigfoot.com>
Subject: Help with perldoc, please.
Message-Id: <as7dga$lbo$1@newshost.mot.com>

This is probably a stupid question, buy hey, if you help me with this one,
it'll save you from more stupid questions about Win32::GUI, etc.

I must have Win32::GUI installed, because I'm using it in my script, and the
"use Win32::GUI;" command doesn't error.[1] The html doc files that came
with my active state installation don't have much information on Win32::GUI,
and I really need to read up on all the features of this module.

So, I tried perldoc...

The only option in perldoc that doesn't say "no documentation available" is
perldoc -m Win32::GUI, but the stuff it spews out is useless to a newbie
like me.

So...How, where, why, what do I have to do to get all the info I need to use
Win32::GUI properly?

Thanks.

R.

[1] Also "ppm query Win32:GUI" reports "Win32-GUI [0.0.558] Perl-Win32
Graphical User Interface Extension".




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

Date: Fri, 29 Nov 2002 11:04:33 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: Help with perldoc, please.
Message-Id: <3de745ed.3829246785@news.cis.dfn.de>

On Fri, 29 Nov 2002 09:47:18 -0000, "Richard S Beckett"
<spikey-wan@bigfoot.com> wrote:

>This is probably a stupid question, buy hey, if you help me with this one,
>it'll save you from more stupid questions about Win32::GUI, etc.
>
>I must have Win32::GUI installed, because I'm using it in my script, and the
>"use Win32::GUI;" command doesn't error.[1] The html doc files that came
>with my active state installation don't have much information on Win32::GUI,
>and I really need to read up on all the features of this module.
>
>So, I tried perldoc...

Good for you, but it's reading exactly the same 
documentation as the HTML version, so you're out of
luck.

>The only option in perldoc that doesn't say "no documentation available" is
>perldoc -m Win32::GUI, but the stuff it spews out is useless to a newbie
>like me.

Well, that option spews out the source code itself.

It appears that Win32::GUI lacks the proper pod 
documentation, indicating that it is perhaps not
quite mature.

You can read the docs online at
http://search.cpan.org/author/ACALPINI/Win32-GUI-0.0.558/

but most of them seem to be empty, indicating that the
whole thing is not quite mature.  The very low version
number would also indicate the same.

>So...How, where, why, what do I have to do to get all the info I need to use
>Win32::GUI properly?

>[1] Also "ppm query Win32:GUI" reports "Win32-GUI [0.0.558] Perl-Win32
>Graphical User Interface Extension".

I much prefer Perl/Tk, but thats just a personal preference,

I have never really used Win32::GUI, only looked at it.  
Perl/Tk is certainly far more complete and enterprise ready.
-- 
Regards, Helgi Briem
helgi AT decode DOT is

                           A: Top posting
                           Q: What is the most irritating thing on Usenet?
                                           - "Gordon" on apihna


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

Date: Fri, 29 Nov 2002 07:40:34 GMT
From: "Jorge Mesa" <jmesam@NOSPAMnospam.terra.es>
Subject: HELP! Looking for a cgi
Message-Id: <SREF9.1204433$nc1.4214949@telenews.teleline.es>

Hello!
I'm looking for a cgi to redirect people from a page to another.
1) The page to be redirected is a htm file.
2) My remote server is windows and support Perl 5.
3) The cgi has to change the server status (HTTP Header) to error 301 Moved
Permanently.

Does anybody where I could find something similar??

Thank you in advance,
Jorge




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

Date: Fri, 29 Nov 2002 09:19:36 -0000
From: "Clyde Ingram" <cingram@pjocsNOSPAMORHAM.demon.co.uk>
Subject: Re: HELP! Looking for a cgi
Message-Id: <as7bc9$k9u$1$8300dec7@news.demon.co.uk>

Jorge,

"Jorge Mesa" <jmesam@NOSPAMnospam.terra.es> wrote
> I'm looking for a cgi to redirect people from a page to another.
> 1) The page to be redirected is a htm file.
> 2) My remote server is windows and support Perl 5.
> 3) The cgi has to change the server status (HTTP Header) to error 301
Moved
> Permanently.

This might help for starters.  Here is "redirect.pl" from Lincoln Stein's
"Official Guide to Programming with CGI.pm", from
http://www.wiley.com/legacy/compbooks/stein/source.html
The book explains this and the other CGI snippets.
I don't know how you would both redirect to another web page AND return the
301 server status, but i guess CGI.pm has a tailor made methods to do just
this.

Hope this helps,
Clyde

#!/usr/bin/perl
#redirect.pl

use CGI qw/:standard/;

print redirect('http://www.wiley.com/compbooks/stein/'),
    start_html("Moved"),
    h1("Document Moved"),
    "The document you have requested has moved ",
    a({href=>'http://www.wiley.com/compbooks/stein/'},"here"),
    '.';






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

Date: Fri, 29 Nov 2002 10:54:03 -0000
From: "Clyde Ingram" <cingram@pjocsNOSPAMORHAM.demon.co.uk>
Subject: Re: Indenting with Data::Dumper::Dump()
Message-Id: <as7gtc$665$1$8302bc10@news.demon.co.uk>

Jay,

Great stuff - problem sorted.

"Jay Tilton" <tiltonj@erols.com> wrote in message
news:3de61a22.328752888@news.erols.com...
> "Clyde Ingram" <cingram@pjocsNOSPAMORHAM.demon.co.uk> wrote:
>
> : I define this
> : hash reference:
> :
> : $fruit = {
> :     yellow => [ banana, lemon ] ,
> :     red_coloured_skin_tone => {
> :         hard_texture => apple,
> :         soft_texture => [ strawberry, raspberry ]
> :     }
> : };
>
> Lots of barewords there.  Developing without strictures enabled?

Steady on there . . . My query is about re-formatting Data::Dumper output -
not about safe Perl.  I deliberately omitted quoting merely to get to the
point of my posting with less visual clutter.  I am a happy disciple of the
advice on numerous documents, e.g., those indexed from
http://www.perl.org/CGI_MetaFAQ.html, including
http://www.perl.com/doc/FAQs/cgi/idiots-guide.html, which tells me:
Q: What happens when you add Perl's -w flag?
A: It tells me about my silly mistakes that are listed in detail in the
perldiag manpage where I diligently looked them up.

Q: What happens when you add Perl's -T flag?
A: It tells me about security problems as described in the perlsec manpage,
which I've carefully read and understood. I even read the CGI Security FAQ.

Q: What happens when you add use strict?
A: It makes me declare my variables and quote my strings and finds all these
silly errors which I've carefully corrected using my() declarations, use
vars, and quotes.

> : Dump() produces something resembing:
>
> [awful line-wrapped output elided]

Yes, it was awful . . . but d'you know what?  I misread the Dumper man page.
If I had not got so fixated on using the default $Data::Dumper::Indent of 2,
which rapidly indents way off the right hand side, I'd have spotted what you
saw, that using Indent = 1 does 90% of the job for me.  (Plenty of Perl
mongers would consider its 2-space indent is 100%.)  You know, I was nearly
going to filter the Indent =2 output through "perltidy".  Duh!

So your addition of:

>         $dump =~ s/^( +)/$1$1/gm;

achieves the rest easily.

> Or you could create a Data::Dumper object and alter its
> padding-per-level string.  I don't see a documented method for this, so
> it's probably the Wrong Thing to do, but...

I found your "naughty naughty" fiddle instructive, but I'll take your hint
and avoid it.

Thank-you for your response,
Clyde




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

Date: Fri, 29 Nov 2002 09:53:03 +0000 (UTC)
From: Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: Learning Perl 3rd Edition Chapter 8 ex3.
Message-Id: <slrnauee2e.7am.bernard.el-hagin@gdndev25.lido-tech>

In article <as67fk$oadbb$1@ID-162318.news.dfncis.de>, Mark Marsella wrote:
> I am currently working through this excellent book but after attempting 
> Exercise 3 in chapter 8 on regular expressions which is -:
> 
> Make a pattern which matches a string containing nothing but a scalar 
> variable's name like $fred $barney or $_ but not $0 etc. I got this
> /^\$\D\w*/
> 
> and wondered if it is correct as the anwser in the appendix is longer.


It's incorrect because it matches stuff like:


  $---

or

  $@%#^@&%#


which aren't legal variable names.



Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'


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

Date: Fri, 29 Nov 2002 10:23:39 +0000
From: markmm <mark@lismark.org>
Subject: Re: Learning Perl 3rd Edition Chapter 8 ex3.
Message-Id: <as7f6c$o5me2$1@ID-162318.news.dfncis.de>

Uri Guttman did say:

>>>>>> "MM" == Mark Marsella <mark@lismark.org> writes:
> 
>   MM> I am currently working through this excellent book but after
>   attempting MM> Exercise 3 in chapter 8 on regular expressions which is
>   -:
> 
>   MM> Make a pattern which matches a string containing nothing but a
>   scalar MM> variable's name like $fred $barney or $_ but not $0 etc. I
>   got this MM> /^\$\D\w*/
> 
> that matches $~foo among many other things which are not proper variable
> names. so the answer has to match tighter than your regex does.
> 
> uri
> 
Ok thanks, I should have tried a wider range of test cases:).

markmm
-- 
 10:22:02 up 2 days, 19:28,  1 user,  load average: 0.52, 0.22, 0.07
 Running Debian 3


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

Date: Fri, 29 Nov 2002 11:01:55 +0000
From: Simon Andrews <simon.andrews@bbsrc.ac.uk>
Subject: Re: New user problem with installing mods
Message-Id: <3DE74923.231D6DC9@bbsrc.ac.uk>

Tim bush wrote:
> 
> Hi
> 
> Just recently installed perl for the first time. Initially I was trying to
> install a module but that didn't work and so I tried a test search for an
> obvious one from the FAQ and stilled got the error in PPM.

> IM running this on NT and version 5.8 of PERL

Well, first off Activstate only have a beta release of 5.8.0 at the
moment so you may expect to still find some bugs, and probably more
limited module support than the latest 5.6.1.633 version.  I would
suggest that as this is your first installation you should go for a
stable release.

Go to:

http://www.activestate.com/Products/Download/Register.plex?id=ActivePerl

to get the latest stable ActivePerl

> 
> With this
> 
> ppm> search CGI
> Searching in Active Repositories
> The system cannot find the path specified.
> Error: connect: Unknown error
> 
> I reading the FAQ s and stuff for these path's but can't seem to find what
> its talking about.

The most common problem when using PPM is when users need to access the
internet through a proxy server.  Unless you tell PPM about your proxy
you will see these kinds of errors.

See

http://aspn.activestate.com/ASPN/Downloads/ActivePerl/PPM/

for more details about PPM, in particular note the section which says
"Quick solutions to the most common known issues/problems"


Hope this helps

Simon.

PS Also, you do know that the CGI module comes as a core module with
ActivePerl, so you don't need to install it through PPM.


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

Date: 29 Nov 2002 07:46:11 GMT
From: vek@station02.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: Regular expression question
Message-Id: <slrnaue6q3.m9n.vek@station02.ohout.pharmapartners.nl>

On Thu, 28 Nov 2002 17:42:53 GMT,
    Bart Lateur <bart.lateur@pandora.be> wrote:


>Steven May wrote:
>
>>my $string = '1234';
>>
>>$string =~ s/(\d\d)(\d\d)/\1:\2/;
>
>You shouldn't be using backquotes on the substitution part -- which is a
>doublequotish string in Perl. Use dollar signs instead, just like in
>normal such strings.
>


Do you mean backslack as in \ or backticks as in ` .  Backquotes usualy
refers to the ` sign.


Villy


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

Date: Fri, 29 Nov 2002 07:55:40 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Regular expression question
Message-Id: <x7n0ns3j44.fsf@mail.sysarch.com>

>>>>> "VK" == Villy Kruse <vek@station02.ohout.pharmapartners.nl> writes:

  VK> On Thu, 28 Nov 2002 17:42:53 GMT,
  VK>     Bart Lateur <bart.lateur@pandora.be> wrote:


  >> Steven May wrote:
  >> 
  >>> my $string = '1234';
  >>> 
  >>> $string =~ s/(\d\d)(\d\d)/\1:\2/;
  >> 
  >> You shouldn't be using backquotes on the substitution part -- which is a
  >> doublequotish string in Perl. Use dollar signs instead, just like in
  >> normal such strings.
  >> 


  VK> Do you mean backslack as in \ or backticks as in ` .  Backquotes usualy
  VK> refers to the ` sign.

he meant backrefs which are the \1 and \2 in the replacement. and he is
correct that they should be $1 and $2.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Fri, 29 Nov 2002 09:11:13 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Regular expression question
Message-Id: <cnbeuu8k58hr3o51bm35jumetalv198h1b@4ax.com>

Villy Kruse wrote:

>Do you mean backslack as in \ or backticks as in ` .  Backquotes usualy
>refers to the ` sign.

Oops, sorry. Yup: I meant backslashes. It was a mistype.

-- 
	Bart.


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

Date: Fri, 29 Nov 2002 06:15:58 GMT
From: Derek Thomson <derek@wedgetail.com>
Subject: Re: Teaching Perl complex data structures
Message-Id: <yCDF9.71$_27.2126@news.optus.net.au>

Tad McClellan wrote:
> Derek Thomson <derek@wedgetail.com> wrote:
> 
> 
>>But I'm looking at this from a teaching and 
>>mentoring perspective. How can I teach this stuff
> 
> 
> 
> There are a lot more Perl trainers on this mailing list:
> 
>    http://lists.perl.org/showlist.cgi?name=perl-trainers
> 
> 
> than there are sloshing around here in the clp.misc swamp.  :-)
> 
> You might want to ask over there too.
> 
> 

I will, but I may lurk a bit first.

Thanks!
Derek.




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

Date: Fri, 29 Nov 2002 09:32:12 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Teaching Perl complex data structures
Message-Id: <q8ceuu09vlcdiecu4olgisqgae6m9tvf7c@4ax.com>

Derek Thomson wrote:

>But I'm looking at this from a teaching and 
>mentoring perspective. How can I teach this stuff in a way that people 
>*appreciate* it's value? Right now, the reaction I get is "this is much 
>simpler in Java/Python/whatever". And it even feels awkward to me while 
>teaching it - I have to get a fair chunk of concepts and new syntax 
>across before we can just nest arrays.

It's not exactly simpler in Perl, but it's a lot more powerful than in
those other languages. For example, in Perl you can simply do

	@foo = (1, 2 , 3);
	@bar = (4, 5);
	push @foo, @bar;

to end up with 1 .. 5. If you try the same in PHP, for example, you get:

	$foo = array(1, 2 , 3);
	$bar = array(4, 5);
	array_push $foo, $bar;

to end up with something like

	array(1, 2, 3, array(4, 5))

and that's annoying, if what you get in Perl is what you want -- and
most of the time, it is what I want. You can't achieve that effect in
PHP. Instead, you need to use a different function:

	$foo2 = array_merge($foo, $bar);

which acts differently: array_merge() is a function, which returns the
concatenated array, but doesn't modify the original.

Say whatever you want, but I find this clumsy. In Perl, you can have it
both ways.


If people want to do Lisp-like stuff in Perl, teach them to always use
square brackets.

-- 
	Bart.


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

Date: Fri, 29 Nov 2002 09:58:44 +0100
From: "Carsten L." <clandos@web.de>
Subject: Re: trigger internal iis 5.0 services
Message-Id: <3de72c46$0$365$4d4ebb8e@read.news.de.uu.net>

finnally i found it by myself

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iisref60/ht
m/mb_config_xsaboutiisclass.asp

thank you for your constructive help
you should help eveyone and earn a lot of money



"Bernard El-Hagin" <bernard.el-hagin@DODGE_THISlido-tech.net> schrieb im
Newsbeitrag news:as2g4q$c95$1@korweta.task.gda.pl...
> In article <3de4bdc0$0$191$4d4ebb8e@read.news.de.uu.net>, Carsten L.
> wrote:
> > Hello!
>
>
> Howdy!
>
>
> > I want to start and stop, resume "internal-web-site"s within the iis
> > service.
>
>
> Good for you. Everyone should have a hobby.
>
>
> > What I do now is to start and stop the W3SVC.
>
>
> Cool.
>
>
> > This stops unfortenuately all web sites at once.
>
>
> Bummer.
>
>
> > Can anyone give me a hint a I can do this?
>
>
> I'm sure there are many ones that can give you a hint a you can do
> this.
>
>
> Hope that helps.
>
>
> Cheers,
> Bernard
> --
> echo 42|perl -pe '$#="Just another Perl hacker,"'




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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 4197
***************************************


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