[30964] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2209 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Feb 14 03:09:45 2009

Date: Sat, 14 Feb 2009 00:09:09 -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           Sat, 14 Feb 2009     Volume: 11 Number: 2209

Today's topics:
        1234567890 is upon us! <jl_post@hotmail.com>
    Re: cpan defaults on first use. Can I provide them in a <nospam@nospam.invalid>
        new CPAN modules on Sat Feb 14 2009 (Randal Schwartz)
    Re: Possible bug in caller(0) ? sln@netherlands.com
    Re: question on de-referencing expressions <tzz@lifelogs.com>
    Re: question on de-referencing expressions <uri@stemsystems.com>
    Re: question on de-referencing expressions (Tim McDaniel)
    Re: question on de-referencing expressions sln@netherlands.com
    Re: question on de-referencing expressions <uri@stemsystems.com>
    Re: question on de-referencing expressions <noreply@gunnar.cc>
        time and place of satellite coincidence <larry@example.invalid>
    Re: time and place of satellite coincidence <tadmc@seesig.invalid>
    Re: Uninstall a module with/without cpan shell <w.c.humann@arcor.de>
    Re: Uninstall a module with/without cpan shell <ben@morrow.me.uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 13 Feb 2009 11:58:32 -0800 (PST)
From: "jl_post@hotmail.com" <jl_post@hotmail.com>
Subject: 1234567890 is upon us!
Message-Id: <51d730f3-0056-44cc-adae-4a22d96c7957@k36g2000pri.googlegroups.com>

Hi,

  As some of you know, Unix epoch time will reach the number
1,234,567,890
today at 23:31:30 UTC.

  If you don't know, epoch time is a measure of time in number of
(non-leap) seconds since Midnight UTC on January 1, 1970.  (That means
over
a billion seconds have passed since then.)

  Nostradamus once cryptically said, "The world will end when all
numbers
are visible."  I wonder if he was talking about this epoch time stuff.
(Disclaimer:  I just made that quote up.)

  You can view the epoch time ticking away by typing the following at
any
DOS/Unix prompt (provided you have Perl installed):

     perl -le "print time and sleep 1  while 1"

(You may want to synchronize your computer's clock by going to
http://www.time.gov/ .)

  You can see the exact time of 1234567890 for your timezone by
typing:

     perl -le "print scalar localtime 1234567890"

  Have a happy 1234567890 day!

  -- Jean-Luc


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

Date: Fri, 13 Feb 2009 18:02:38 +0000 (UTC)
From: Rahul <nospam@nospam.invalid>
Subject: Re: cpan defaults on first use. Can I provide them in a non-interative format?
Message-Id: <Xns9BB17A8569A46650A1FC0D7811DDBC81@85.214.105.209>

Christian Winter <thepoet_nospam@arcor.de> wrote in news:49948c1f$0$31328
$9b4e6d93@newsspool4.arcor-online.net:

> You can simply overwrite the CPAN/Config.pm file, that's where
> the config information is stored (the real functionality for
> CPAN::Config is located in CPAN.pm itself, so it's safe.)
> 
> 

Thanks Christian. I'll copy that file from the one node that I already 
manually set up. That should allow me to clone the others much faster. 

-- 
Rahul


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

Date: Sat, 14 Feb 2009 05:42:24 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sat Feb 14 2009
Message-Id: <KF1Juo.478@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.

Acme-CPANAuthors-Acme-CPANAuthors-Authors-0.1234567890
http://search.cpan.org/~sanko/Acme-CPANAuthors-Acme-CPANAuthors-Authors-0.1234567890/
We are CPAN authors who have authored Acme::CPANAuthors modules 
----
Apache2-ASP-2.28
http://search.cpan.org/~johnd/Apache2-ASP-2.28/
ASP for Perl, reloaded. 
----
App-Maisha-0.01
http://search.cpan.org/~barbie/App-Maisha-0.01/
A command line social micro-blog networking tool. 
----
App-Sequence-0.0206
http://search.cpan.org/~kimoto/App-Sequence-0.0206/
pluggable subroutine engine. 
----
App-Textcast-0.05.13
http://search.cpan.org/~nkh/App-Textcast-0.05.13/
Light weight text casting 
----
Astro-SpaceTrack-0.038
http://search.cpan.org/~wyant/Astro-SpaceTrack-0.038/
Retrieve orbital data from www.space-track.org. 
----
Astro-satpass-0.021
http://search.cpan.org/~wyant/Astro-satpass-0.021/
----
B-Hooks-OP-Annotation-0.30
http://search.cpan.org/~chocolate/B-Hooks-OP-Annotation-0.30/
Annotate and delegate hooked OPs 
----
CGI-Mungo-1.1
http://search.cpan.org/~dumb/CGI-Mungo-1.1/
Very simple CGI web framework 
----
CPAN-Mini-ProjectDocs-0.01_01.2
http://search.cpan.org/~nkh/CPAN-Mini-ProjectDocs-0.01_01.2/
generates nice module documentation from you CPAN mini 
----
CPAN-PackageDetails-0.17
http://search.cpan.org/~bdfoy/CPAN-PackageDetails-0.17/
Create or read 02packages.details.txt.gz 
----
CPAN-Testers-Data-Uploads-0.04
http://search.cpan.org/~barbie/CPAN-Testers-Data-Uploads-0.04/
CPAN Testers Uploads Database Generator 
----
Class-Axelerator-0.01
http://search.cpan.org/~dankogai/Class-Axelerator-0.01/
Evade OO taxes 
----
DBIx-Class-0.08012
http://search.cpan.org/~ribasushi/DBIx-Class-0.08012/
Extensible and flexible object <-> relational mapper. 
----
DateTime-Format-Natural-0.74_03
http://search.cpan.org/~schubiger/DateTime-Format-Natural-0.74_03/
Create machine readable date/time with natural parsing logic 
----
Devel-NYTProf-2.07_96
http://search.cpan.org/~timb/Devel-NYTProf-2.07_96/
Powerful feature-rich perl source code profiler 
----
Dist-Zilla-Plugin-PodWeaver-2.000
http://search.cpan.org/~rjbs/Dist-Zilla-Plugin-PodWeaver-2.000/
do horrible things to POD, producing better docs 
----
Encode-JP-Mobile-0.26
http://search.cpan.org/~miyagawa/Encode-JP-Mobile-0.26/
????????? Shift_JIS (CP932) / UTF-8 ???????? 
----
Error-Return-0.01
http://search.cpan.org/~marcel/Error-Return-0.01/
return(), skipping a scope 
----
Glib-1.201
http://search.cpan.org/~tsch/Glib-1.201/
Perl wrappers for the GLib utility and Object libraries 
----
Gtk2-1.203
http://search.cpan.org/~tsch/Gtk2-1.203/
Perl interface to the 2.x series of the Gimp Toolkit library 
----
HTML-Spry-DataSet-0.01
http://search.cpan.org/~adamk/HTML-Spry-DataSet-0.01/
Generate HTML Table Data Set files for the Spry Javascript toolkit 
----
Image-TextMode-0.05
http://search.cpan.org/~bricas/Image-TextMode-0.05/
Create, manipulate and save text mode images 
----
Image-TextMode-Reader-ANSI-XS-0.01
http://search.cpan.org/~bricas/Image-TextMode-Reader-ANSI-XS-0.01/
Fast ANSI image parsing 
----
Inline-Flex-0.01_01.2
http://search.cpan.org/~nkh/Inline-Flex-0.01_01.2/
Inline module to use flex generated lexers 
----
Integer-Tiny-0.3
http://search.cpan.org/~bbkr/Integer-Tiny-0.3/
Shorten and obfuscate your Integer values. Just like IDs on YouTube! 
----
MP3-CreateInlayCard-0.06
http://search.cpan.org/~bigpresh/MP3-CreateInlayCard-0.06/
create a CD inlay label for a directory of MP3 files 
----
MediaWiki-Bot-Plugin-CUP-0.3.2
http://search.cpan.org/~dcollins/MediaWiki-Bot-Plugin-CUP-0.3.2/
a plugin for MediaWiki::Bot which contains data retrieval tools for the 2009 WikiCup hosted on the English Wikipedia 
----
MediaWiki-Bot-Plugin-SE-0.2.1
http://search.cpan.org/~dcollins/MediaWiki-Bot-Plugin-SE-0.2.1/
a plugin for MediaWiki::Bot which contains data retrieval tools for the 2009 Steward elections 
----
MooseX-MethodAttributes-0.01
http://search.cpan.org/~flora/MooseX-MethodAttributes-0.01/
code attribute introspection 
----
Mungo-1.0
http://search.cpan.org/~dumb/Mungo-1.0/
Very simple CGI web framework 
----
Net-BitTorrent-0.050
http://search.cpan.org/~sanko/Net-BitTorrent-0.050/
BitTorrent peer-to-peer protocol class 
----
Net-OpenSSH-0.30
http://search.cpan.org/~salva/Net-OpenSSH-0.30/
Perl SSH client package implemented on top of OpenSSH 
----
Net-SFTP-Foreign-1.47
http://search.cpan.org/~salva/Net-SFTP-Foreign-1.47/
SSH File Transfer Protocol client 
----
Number-Format-1.70
http://search.cpan.org/~wrw/Number-Format-1.70/
Perl extension for formatting numbers 
----
POE-Component-Server-NRPE-0.12
http://search.cpan.org/~bingos/POE-Component-Server-NRPE-0.12/
A POE Component implementation of NRPE Daemon. 
----
Simo-0.07_05
http://search.cpan.org/~kimoto/Simo-0.07_05/
Very simple framework for Object Oriented Perl. 
----
Simo-0.0801
http://search.cpan.org/~kimoto/Simo-0.0801/
Very simple framework for Object Oriented Perl. 
----
Simo-Constrain-0.0201
http://search.cpan.org/~kimoto/Simo-Constrain-0.0201/
Constrain functions for Simo; 
----
TAP-DOM-0.01
http://search.cpan.org/~schwigon/TAP-DOM-0.01/
TAP as document data structure. 
----
Term-Emit-0.0.2
http://search.cpan.org/~roscio/Term-Emit-0.0.2/
Print with indentation, status, and closure 
----
Term-Emit-Format-HTML-0.0.2
http://search.cpan.org/~roscio/Term-Emit-Format-HTML-0.0.2/
Formats Term::Emit output into HTML 
----
Term-ScreenColor-1.10
http://search.cpan.org/~ruittenb/Term-ScreenColor-1.10/
Screen positioning and coloring module for Perl 
----
Test-Behaviour-Spec-0.02
http://search.cpan.org/~tociyuki/Test-Behaviour-Spec-0.02/
Interiors of tests for the Behaviour Driven Developments. 
----
Test-Grian-Data-Dumper-0.03
http://search.cpan.org/~grian/Test-Grian-Data-Dumper-0.03/
Perl extension for blah blah blah 
----
TheSchwartz-Moosified-0.02
http://search.cpan.org/~fayland/TheSchwartz-Moosified-0.02/
TheSchwartz based on Moose! 
----
WWW-NicoVideo-Download-0.02
http://search.cpan.org/~miyagawa/WWW-NicoVideo-Download-0.02/
Download FLV/MP4/SWF files from nicovideo.jp 
----
WordNet-SenseRelate-AllWords-0.14
http://search.cpan.org/~tpederse/WordNet-SenseRelate-AllWords-0.14/
Disambiguate All Words in a Text based on semantic similarity and relatedness in WordNet 
----
libwww-perl-5.824
http://search.cpan.org/~gaas/libwww-perl-5.824/


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: Fri, 13 Feb 2009 23:35:22 GMT
From: sln@netherlands.com
Subject: Re: Possible bug in caller(0) ?
Message-Id: <bqubp4ld96kvo14geognghcu2b7fjrcfcf@4ax.com>

On Tue, 10 Feb 2009 20:55:46 -0800, "szr" <szrRE@szromanMO.comVE> wrote:

>Given the code and output below, I believe there to be a bug in caller, 
>specifically when called with a sole argument of 0 (zero.) In the output 
>below, I get back the subroutine (method), B::foo, which is located in 
>Package "B", inside file Test.pm, at line 10, yet caller(0) is yielding 
>Package "main", file main.pl, and line 8.
>
>The latter location is where 'foo' was called /from/, but caller(0), 
>according to `perldoc5.10.0 -f caller`, whose first four elements are 
>defined as "$package, $filename, $line, $subroutine", states that:
>
>   The value of EXPR indicates how many call frames to go back
>   before the current one.
>
>Therefore 0 should be the current frame, and while the subroutine is 
>correct, is appears the package, file, and line number (aka, the 
>location of said subroutine), is incorrect. I would have expected 
>caller(1) to return where it was called _from_, but caller(0) be giving 
>the location of the subroutine where caller was called.
>
>If I am missing something, please let me know. I have thought though 
>this for a couple hours and read over that perldoc entry several times 
>before writing this.
>
>Thank you.
>
>
[snip]

Usually call frames tell info obout the caller(s), what was passed, so its mostly about
the call stack or call tree, to trace back the sequence. Its a good debug tool.
Microsoft VS development ide has an excellent one.

($package, $filename, $line, $subroutine) = caller(0); is a stack frame (kinda) of the subroutine caller.

In your case, $d->foo(), the last called before 'caller()' was invoked, was called from the 'main' package,
your filename was 'main.pl', the line in main.pl was 8, and the subroutine called was B::foo.

Take a look at the sample and output below.

  The first call to $d->foo() was made at the end of package D. So, you get this:   d->foo() = [D, iii.pl, 31, B::foo]
  The first call to $e->foo() was made at the end of package E. So, you get this:   e->foo() = [E, iii.pl, 52, B::foo]
  The second call to $d->foo() was made at the end of package E. So, you get this:  d->foo() = [E, iii.pl, 53, B::foo]

  Then "$e->bar()" was called. E::bar() calls E::foo() which calls B::foo() in the SUPER class.
  Even though the $e->bar() call was made on line 54, E::foo() gets called on line 47, so you get this:   e->bar() = [E, iii.pl, 47, B::foo]
  If you were to change B::foo to go one stack frame back like this 'caller(1)', then you get this:       e->bar() = [E, iii.pl, 54, E::bar]

Try to put everything in one .pl file when you are experimenting, unless you want to try it with use/require blocks.

Good luck.
-sln

## iii.pl
use strict;
use warnings;

##
package B;
our @ISA = qw();

sub new {
   my $this = shift;
   return bless { }, ref($this) || $this;
}

sub foo {
   my $this = shift;
   return join (', ', (caller(0))[0..3]);
}

##
package D;
our @ISA = qw(B);

sub new {
   my $this = shift;
   my $class = ref($this) || $this;
   my $obj = $class->SUPER::new(@_);
   return bless $obj, $class;
}

my $d = new D;
print "d->foo() = [", $d->foo(), "]\n";


##
package E;
our @ISA = qw(B);

sub new {
   my $this = shift;
   my $class = ref($this) || $this;
   my $obj = $class->SUPER::new(@_);
   return bless $obj, $class;
}

sub bar {
   my $this = shift;
   return $this->foo();
}


my  $e = new E;
print "e->foo() = [", $e->foo(), "]\n";
print "d->foo() = [", $d->foo(), "]\n";
print "e->bar() = [", $e->bar(), "]\n";

__END__

Output:

d->foo() = [D, iii.pl, 31, B::foo]
e->foo() = [E, iii.pl, 52, B::foo]
d->foo() = [E, iii.pl, 53, B::foo]
e->bar() = [E, iii.pl, 47, B::foo]





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

Date: Fri, 13 Feb 2009 09:08:55 -0600
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: question on de-referencing expressions
Message-Id: <86fxiicr20.fsf@lifelogs.com>

On 12 Feb 2009 22:32:12 GMT jt@toerring.de (Jens Thoms Toerring) wrote: 

JTT> olingaa@gmail.com <olingaa@gmail.com> wrote:
>> Is there a way do this with one assignment so that the $hash_ref
>> variable is not necessary?

>> my $hash_ref = functionReturningReference();
>> my %hash = %$hash_ref;

JTT> my %hash = %{ functionReturningReference() };

On Thu, 12 Feb 2009 23:33:22 +0100 Gunnar Hjalmarsson <noreply@gunnar.cc> wrote: 

GH>     my %hash = %{ functionReturningReference() };

It's worth noting here that if the returned value is undef, the program
will die here.  This is why I always use an intermediate variable and
test if for definedness, even if it takes a few more lines.

Ted


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

Date: Fri, 13 Feb 2009 13:41:55 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: question on de-referencing expressions
Message-Id: <x7hc2yw558.fsf@mail.sysarch.com>

>>>>> "TZ" == Ted Zlatanov <tzz@lifelogs.com> writes:

  TZ> On 12 Feb 2009 22:32:12 GMT jt@toerring.de (Jens Thoms Toerring) wrote: 
  JTT> olingaa@gmail.com <olingaa@gmail.com> wrote:
  >>> Is there a way do this with one assignment so that the $hash_ref
  >>> variable is not necessary?

  >>> my $hash_ref = functionReturningReference();
  >>> my %hash = %$hash_ref;

  JTT> my %hash = %{ functionReturningReference() };

  TZ> On Thu, 12 Feb 2009 23:33:22 +0100 Gunnar Hjalmarsson <noreply@gunnar.cc> wrote: 

  GH> my %hash = %{ functionReturningReference() };

  TZ> It's worth noting here that if the returned value is undef, the program
  TZ> will die here.  This is why I always use an intermediate variable and
  TZ> test if for definedness, even if it takes a few more lines.

where did you get that result?

perl -e '%h = %{$x}'
perl -e '%h = %{undef}'

neither caused a die.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Fri, 13 Feb 2009 23:25:46 +0000 (UTC)
From: tmcd@panix.com (Tim McDaniel)
Subject: Re: question on de-referencing expressions
Message-Id: <gn4vhp$chv$1@reader1.panix.com>

In article <x7hc2yw558.fsf@mail.sysarch.com>,
Uri Guttman  <uri@stemsystems.com> wrote:
>  GH> my %hash = %{ functionReturningReference() };
>
>  TZ> It's worth noting here that if the returned value is undef, the program
>  TZ> will die here.  This is why I always use an intermediate variable and
>  TZ> test if for definedness, even if it takes a few more lines.
>
>where did you get that result?
>
>perl -e '%h = %{$x}'
>perl -e '%h = %{undef}'
>
>neither caused a die.

-w and "use strict" show different things.  Note that the first test
shows that %{undef} doesn't mean what you and I thought it meant.

    $ perl -we '%h = %{undef}'
    Ambiguous use of %{undef} resolved to %undef at -e line 1.
    Name "main::h" used only once: possible typo at -e line 1.
    Name "main::undef" used only once: possible typo at -e line 1.

    $ perl -we 'my %h = %{undef()}'
    Use of uninitialized value at -e line 1.

    $ perl -e 'my %h = %{undef()}'
    [no output]

    $ perl -we 'use strict; my %h = %{undef()}'
    Can't use an undefined value as a HASH reference at -e line 1.

-- 
Tim McDaniel, tmcd@panix.com


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

Date: Sat, 14 Feb 2009 00:44:29 GMT
From: sln@netherlands.com
Subject: Re: question on de-referencing expressions
Message-Id: <ub4cp4ldvds0rj08j15p2i28sua71rc9vr@4ax.com>

On Fri, 13 Feb 2009 23:25:46 +0000 (UTC), tmcd@panix.com (Tim McDaniel) wrote:

>In article <x7hc2yw558.fsf@mail.sysarch.com>,
>Uri Guttman  <uri@stemsystems.com> wrote:
>>  GH> my %hash = %{ functionReturningReference() };
>>
>>  TZ> It's worth noting here that if the returned value is undef, the program
>>  TZ> will die here.  This is why I always use an intermediate variable and
>>  TZ> test if for definedness, even if it takes a few more lines.
>>
>>where did you get that result?
>>
>>perl -e '%h = %{$x}'
>>perl -e '%h = %{undef}'
>>
>>neither caused a die.
>
>-w and "use strict" show different things.  Note that the first test
>shows that %{undef} doesn't mean what you and I thought it meant.
>
>    $ perl -we '%h = %{undef}'
>    Ambiguous use of %{undef} resolved to %undef at -e line 1.
>    Name "main::h" used only once: possible typo at -e line 1.
>    Name "main::undef" used only once: possible typo at -e line 1.
>
>    $ perl -we 'my %h = %{undef()}'
>    Use of uninitialized value at -e line 1.
>
>    $ perl -e 'my %h = %{undef()}'
>    [no output]
>
>    $ perl -we 'use strict; my %h = %{undef()}'
>    Can't use an undefined value as a HASH reference at -e line 1.
                     ^^^                      ^^^^
Because it does not indirectly point to an intrinsic type, variable, when its
cast as a reference (by dereferencing it).
my $p;
$$p;



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

Date: Fri, 13 Feb 2009 19:49:49 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: question on de-referencing expressions
Message-Id: <x78wo9u9jm.fsf@mail.sysarch.com>

>>>>> "TM" == Tim McDaniel <tmcd@panix.com> writes:

  TM> In article <x7hc2yw558.fsf@mail.sysarch.com>,
  TM> Uri Guttman  <uri@stemsystems.com> wrote:
  GH> my %hash = %{ functionReturningReference() };
  >> 
  TZ> It's worth noting here that if the returned value is undef, the program
  TZ> will die here.  This is why I always use an intermediate variable and
  TZ> test if for definedness, even if it takes a few more lines.
  >> 
  >> where did you get that result?
  >> 
  >> perl -e '%h = %{$x}'
  >> perl -e '%h = %{undef}'
  >> 
  >> neither caused a die.

  TM> -w and "use strict" show different things.  Note that the first test
  TM> shows that %{undef} doesn't mean what you and I thought it meant.

  TM>     $ perl -we '%h = %{undef}'
  TM>     Ambiguous use of %{undef} resolved to %undef at -e line 1.
  TM>     Name "main::h" used only once: possible typo at -e line 1.
  TM>     Name "main::undef" used only once: possible typo at -e line 1.

hmm. yep.

  TM>     $ perl -we 'my %h = %{undef()}'

i tried it with +undef for the same result

  TM>     Use of uninitialized value at -e line 1.

and that is a warning, not die.

  TM>     $ perl -e 'my %h = %{undef()}'
  TM>     [no output]

  TM>     $ perl -we 'use strict; my %h = %{undef()}'
  TM>     Can't use an undefined value as a HASH reference at -e line 1.

that is a runtime die under strict.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Sat, 14 Feb 2009 05:57:33 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: question on de-referencing expressions
Message-Id: <6vn167Fl1q4hU1@mid.individual.net>

Ted Zlatanov wrote:
> On 12 Feb 2009 22:32:12 GMT jt@toerring.de (Jens Thoms Toerring) wrote: 
> 
> JTT> olingaa@gmail.com <olingaa@gmail.com> wrote:
>>> Is there a way do this with one assignment so that the $hash_ref
>>> variable is not necessary?
> 
>>> my $hash_ref = functionReturningReference();
>>> my %hash = %$hash_ref;
> 
> JTT> my %hash = %{ functionReturningReference() };
> 
> On Thu, 12 Feb 2009 23:33:22 +0100 Gunnar Hjalmarsson <noreply@gunnar.cc> wrote: 
> 
> GH>     my %hash = %{ functionReturningReference() };
> 
> It's worth noting here that if the returned value is undef, the program
> will die here.

If a function, that is supposed to return a hashref, returns undef, it 
indicates some sort of failure, so die()ing may be a good thing.

> This is why I always use an intermediate variable and
> test if for definedness, even if it takes a few more lines.

That sounds wise if undef is a normal return value.

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


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

Date: Fri, 13 Feb 2009 22:14:58 -0700
From: Larry Gates <larry@example.invalid>
Subject: time and place of satellite coincidence
Message-Id: <120u4gegbj7t$.uh4zh99qk7ui$.dlg@40tude.net>



For persons who study our spacial roller derby, it was an eventful week.  A
satellite built in the soviet era and an american, the uss colbert,
collided above Siberia.  While there are those who may have lost millions
of dollars in the collision, I can't imagine a suit that wouldn't be
laughed out of court, if only because you would necessarily be in the
*other guy's court.*  Either Americans sue Putin, *bcyevo horoshova,* or
russinas sue an american satellite company that caused nobody harm.

So it is that I think both space agencies best work together to recover the
data of this orbital orgasm for rocket scientists.  Of course, each side
will need two weeks before initial contact at the agency level.  This was a
violation of reykjavik, if the american accelerated toward the hurtling
rock.  It is also a violation of reykjavik, if the russian satellite got an
IQ boost before impact.

Anyways, this is my version of determining the most time sensitive problem
with these data.  Where and when did it occur?


use strict;
  use warnings;
  use LWP::Simple;

  # load the complete content of the url in question
  # via LWP::Simple::get(...)

my $site_url = 'http://www.fourmilab.ch/cgi-bin/Yoursky';
my $url_args = 'z=1&lat=65.0&ns=North&lon=90&ew=East';

my $t = 'Something went right!';
print "t is $t\n"; 

$t = (get "$site_url?$url_args" or "Problem");


print "t is $t\n";


#  perl tree4.pl


I believe that the julian time of the coincidence is shown here:
http://i41.tinypic.com/2pqrupy.jpg

I have this as a leftover part from previous inquiries:

foreach my $elem ( $tree->find_by_attribute('name', 'jd') ) {
    print $elem->attr('value'), "\n";
}

This will get me the julian time from this point north and west of the
cosmopolitan of yakutsk.  How do I instead, give IT the julian time from a
perl script?

I've taken a look at the cpan for TreeuBuilder.  A lot of it I don't get.
This is what a synopsis looks like:

  foreach my $file_name (@ARGV) {
    my $tree = HTML::TreeBuilder->new; # empty tree
    $tree->parse_file($file_name);
    print "Hey, here's a dump of the parse tree of $file_name:\n";
    $tree->dump; # a method we inherit from HTML::Element
    print "And here it is, bizarrely rerendered as HTML:\n",
      $tree->as_HTML, "\n";
    
    # Now that we're done with it, we must destroy it.
    $tree = $tree->delete;
  }

<center><h1>Sky above 65N 90E at Sat 2009 Feb 14 4:33 UTC</h1></center>
<center>

How do I grab what lies between the center tags?

-- 
larry gates

Well, enough clowning around.  Perl is, in intent, a cleaned up and
summarized version of that wonderful semi-natural language known as
"Unix".
             -- Larry Wall in <1994Apr6.184419.3687@netlabs.com>


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

Date: Fri, 13 Feb 2009 23:42:26 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: time and place of satellite coincidence
Message-Id: <slrngpcme2.gh1.tadmc@tadmc30.sbcglobal.net>

Larry Gates <larry@example.invalid> wrote:

> I have this as a leftover part from previous inquiries:
>
> foreach my $elem ( $tree->find_by_attribute('name', 'jd') ) {
>     print $elem->attr('value'), "\n";
> }
>
> This will get me the julian time from this point north and west of the
> cosmopolitan of yakutsk.  How do I instead, give IT the julian time from a
> perl script?


    perldoc -q form

        How do I automate an HTML form submission?


><center><h1>Sky above 65N 90E at Sat 2009 Feb 14 4:33 UTC</h1></center>
><center>
>
> How do I grab what lies between the center tags?


 ------------------------------
#!/usr/bin/perl
use warnings;
use strict;
use HTML::TreeBuilder;
use LWP::Simple;

my $site_url = 'http://www.fourmilab.ch/cgi-bin/Yoursky';
my $url_args = 'z=1&lat=35.0836&ns=North&lon=106.651&ew=West';
my $t = get "$site_url?$url_args" || "Problem";

my $tree = HTML::TreeBuilder->new_from_content($t);

foreach my $elem ( $tree->look_down('_tag', 'center') ) {
    print $elem->as_text(), "\n";
}
 ------------------------------


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


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

Date: Fri, 13 Feb 2009 06:46:43 -0800 (PST)
From: Wolfram Humann <w.c.humann@arcor.de>
Subject: Re: Uninstall a module with/without cpan shell
Message-Id: <4afcb378-3f9a-44ac-893a-fdad29b46523@v39g2000yqm.googlegroups.com>

As far as I know, this is only possible with CPANPLUS:

perl -MCPANPLUS -eshell

CPANPLUS is a core module in 5.10. Otherwise you need to install it
from CPAN -- if installing one module to be able to unstall another is
acceptable to you ;-)

Wolfram


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

Date: Fri, 13 Feb 2009 17:35:16 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Uninstall a module with/without cpan shell
Message-Id: <kjng66-o12.ln1@osiris.mauzo.dyndns.org>


Quoth "Thomas Steinbach" <steinbach@gmx-topmail.de>:
> Hello NG,
> 
> How can I unistall a module from/within or
> without the cpan shell? There is no such
> an option...
> 
> For example:
> After I compiled perl (win32) and installed the
> base "system" there is a module
> 
> Module::Build::Platform::Amiga
> 
> and I think I never will need or use
> this module. How can I remove it?

See the example code in the documentation for ExtUtils::Packlist.

Ben



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

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


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