[22929] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5149 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 28 09:05:51 2003

Date: Sat, 28 Jun 2003 06:05:07 -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           Sat, 28 Jun 2003     Volume: 10 Number: 5149

Today's topics:
        ASP -> Perl Script HELP ..NEWBIE>. <jessanik@rogers.com>
    Re: Attn: christian  <bart.lateur@pandora.be>
    Re: Better Way <abigail@abigail.nl>
    Re: How does @LAST_MATCH_START work? <nospam-abuse@ilyaz.org>
        Module for sorting (while either reading from or writin <bik.mido@tiscalinet.it>
    Re: No error for calling undefined sub's? (Jay Tilton)
    Re: Reading JPEG file <REMOVEsdnCAPS@comcast.net>
    Re: scalars and namespace <REMOVEsdnCAPS@comcast.net>
    Re: scalars and namespace <bdonlan@bd-home-comp.no-ip.org>
    Re: Using Perl with ESRI ArcGIS? Or VB foolishness? (dnrg)
        why doesn't Perl's shift take a count argument? <jidanni@jidanni.org>
    Re: why doesn't Perl's shift take a count argument? <erutiurf@web.de>
    Re: why doesn't Perl's shift take a count argument? <uri@stemsystems.com>
    Re: why doesn't Perl's shift take a count argument? (Greg Bacon)
        Yet another "undefined reference to `_WinMain@16'" in c (Sam Denton)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 28 Jun 2003 03:27:17 GMT
From: "kalusalu" <jessanik@rogers.com>
Subject: ASP -> Perl Script HELP ..NEWBIE>.
Message-Id: <pW7La.2667$2ay.1844@news01.bloor.is.net.cable.rogers.com>

Hello..I was browsing thru the newsgroups ...and was wondering if anyone
here can be of assistance to me....as I am very very new to PERL..and have
this ASP SCRIPT..I have to convert...

<%
'Response.Content.Type = "text/plain"
vpath = Request("vpath")

IF vpath = "" then
vpath = "/"
END IF

realPath = server.mappath(vpath)

Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(realPath)

response.write f.Size & vbcrlf
response.write.realPath & vbcrlf
response.write vpath & vbcrlf
%>

it outputs the following:
34342323423  D:\www-roots\www.example.com.80/wwwroot/

the diskusage    the real path     the virtual path

I have written this..

#  $d = det_dir_name();

 $size = 0;
 DIR = opendir $d

  While (readdir DIR) {
   next if /^\.\.?$/ ;
   next if -d$_;
   $size == -s $_;
   }

print $size
print $d

cannot find a function for this det dir name...any ideas..and how I convert
this ASP SCRIPT ????







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

Date: Sat, 28 Jun 2003 12:37:32 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Attn: christian 
Message-Id: <6s2rfvo6dalq7jetiujg6fskh27mv1ubll@4ax.com>

anneliese@scansoft.com wrote:

>The two url's for reporting child
>pornography or software piracy quick links list. Good luck christian.

Child pornography and software pircay get considered as equally morally
bad? *boggle*

Anyway, you're spamming.

-- 
	Bart.


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

Date: 28 Jun 2003 10:06:37 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Better Way
Message-Id: <slrnbfqq5d.el.abigail@alexandra.abigail.nl>

Johannes Fürnkranz (johannes.fuernkranz@t-online.de) wrote on MMMDLXXXVII
September MCMXCIII in <URL:news:bdijrs$okv$05$1@news.t-online.com>:
:)  Abigail wrote:
:) |
:) > `'  $line = join ' ', (split ' ',$line)[8];
:) > 
:) > That join doesn't make much sense. (...)[8] indexes on a list,
:) > returning exactly one element. The join then becomes very trivial.
:)  
:)  You're right. I meant [0..8], of course.

Why? The OP wanted the 9th field, not the first 9 fields.



Abigail
-- 
@_=map{[$!++=>$_^$/]}split$²=>"\@\x7Fy~*kde~box*Zoxf*Bkiaox";$\="\r";
$|=++$*;do{($#=>$=)=(rand@_=>rand@_);@_[$#,$=]=@_[$=,$#]}for($*..@_);
for$:($|..@_-$|){for($|..@_-$:){@_[$_-$|,$_]=@_[$_=>$_-$*]if$_[$_][$¼
]<$_[$_-$*][$®];print+map{$_->[$|]}@_;select$·,$°,$½,"$[.$|"}}print$/


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

Date: Sat, 28 Jun 2003 12:25:42 +0000 (UTC)
From:  Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: How does @LAST_MATCH_START work?
Message-Id: <bdk1g6$2ra5$1@agate.berkeley.edu>

[A complimentary Cc of this posting was sent to
Olof Karlberg 
<Olof.KarlbergNOSPAMat.ebc.uu.se>], who wrote in article <20030627124402.290b5355.Olof.KarlbergNOSPAMatebc.uu.se@molev155.ebc.uu.se>:
> > Some time ago the parser had a hard time groking this.  I would try
> > $#{'-'} or some such instead.

> Thanks, but the result is the same. I also noted that $-[-1] ==
  $-[0] which means that @- only holds one element although the string
  should match twice.

Given that @- is magic, this should not mean anything (at least when
you *know* that things are not working as expected ;-).

Hope this helps,
Ilya


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

Date: Sat, 28 Jun 2003 14:32:11 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Module for sorting (while either reading from or writing to) a FH?
Message-Id: <ej0rfvg3vdevforo7hbdb0s9k36k6be3t4@4ax.com>

One advantage of Perl's built in sort() over *nix 'sort' utility is
its flexibility. However, especially in one-liners, when I just need
to sort my input or output, it is easier to pipe from or to 'sort'.

Now I know that Perl supports tied filehandles: I wonder if there
exists a module that automatically ties a filehandle to a sub that,
for each print() statement, instead of printing the string it would,
puts it into an array and prints the sorted array as a whole when the
FH is closed. Dually it should work in a similar way for each read().

Please forgive me for the wording, but I couldn't express myself
better. However I'm referring to something that would allow some code
like this:

  #!/usr/bin/perl
  use strict
  use warnings
  use Sort::FH STDOUT => sub {...}
  
  while (<>) {
    s/^.*:+//;
    print;
  }

In case it just doesn't exist, (i) would it be possible to write one?
(ii) could it be done in a manner consistent with -i (and -pi,
and...)?


Michele
-- 
$\=q.,.,$_=q.print'  ,\g,,( w,a'c'e'h,,map{$_-=qif/g/;chr
}107..q[..117,q)[map+hex,split//,join' ,2B,, w$ECDF078D3'
F9'5F3014$,$,];];$\.=$/,s,q,32,g,s,g,112,g,y,' , q,,eval;


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

Date: Sat, 28 Jun 2003 02:09:34 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: No error for calling undefined sub's?
Message-Id: <3efcf860.525397164@news.erols.com>

kalasend@yahoo.com (kalasend) wrote:

: Since some point in time the script is not complaining about calls of
: any undefined subroutines(e.g. by a typo). It simply exits, like it
: finished running. It didn't use to do that but I can't possibly
: remember what change I made caused this.
: What is likely to be wrong here?

WAG: The program has an AUTOLOAD{} routine that is behaving rudely.



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

Date: Fri, 27 Jun 2003 21:08:32 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Reading JPEG file
Message-Id: <Xns93A7E1198DB00sdn.comcast@206.127.4.25>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

Zvone Zagar <zvone.zagar@siol.net> wrote in
news:l_4La.1859$78.94796@news.siol.net: 

> I have searched for days, but found almost nothing (except some
> excerpts from C code).
> I hope I made myself clear enough. Any help would be appreciated.

How about Image::Magick, or the GD module?

- -- 
Eric
$_ =  reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print

-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPvz4a2PeouIeTNHoEQJNEwCdH0QWF8H8ril5E27f9R9yd/nd++YAn3Ly
cc8UAjQRM2YhRylTFiVtB9Wd
=Urtr
-----END PGP SIGNATURE-----


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

Date: Fri, 27 Jun 2003 21:07:31 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: scalars and namespace
Message-Id: <Xns93A7E0ED5E7B0sdn.comcast@206.127.4.25>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

Jeff Thies <cyberjeff@sprintmail.com> wrote in 
news:3EFCBA74.199FFEB@sprintmail.com:

>   I have all these "config" files with lists of global scalars:
 ...
> Now I want to import those into a sub and make that list of scalars
> local to that sub. (I want to do something with the list of scalars in
> all these "config" files one file at a time) How do I do that?

I guess it depends on what you want to do.  I'm kinda unclear on what 
you're trying to accomplish.  (What does "local to that sub" mean?)

- -- 
Eric
$_ =  reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print

-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPvz4LmPeouIeTNHoEQIx/QCg/NnMzSp54UFFf1O8f2+/j2GsJBQAoIe8
MEQJ5TdALv8Af1sQstoHApyS
=fVfd
-----END PGP SIGNATURE-----


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

Date: Fri, 27 Jun 2003 22:53:22 -0400
From: "bd" <bdonlan@bd-home-comp.no-ip.org>
Subject: Re: scalars and namespace
Message-Id: <pan.2003.06.28.02.53.20.880225@bd-home-comp.no-ip.org>

On Fri, 27 Jun 2003 21:07:31 -0500, Eric J. Roode wrote:

> Jeff Thies <cyberjeff@sprintmail.com> wrote in 
> news:3EFCBA74.199FFEB@sprintmail.com:
> 
>>   I have all these "config" files with lists of global scalars:
> ...
>> Now I want to import those into a sub and make that list of scalars
>> local to that sub. (I want to do something with the list of scalars in
>> all these "config" files one file at a time) How do I do that?
> 
> I guess it depends on what you want to do.  I'm kinda unclear on what 
> you're trying to accomplish.  (What does "local to that sub" mean?)

Perhaps he means a lexical variable? Beyond that, I don't know.

-- 
Freenet distribution not available
If you don't do it, you'll never know what would have happened if you
had done it.



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

Date: 28 Jun 2003 05:37:39 -0700
From: dananrg@yahoo.com (dnrg)
Subject: Re: Using Perl with ESRI ArcGIS? Or VB foolishness?
Message-Id: <c1888d06.0306280437.11c8f579@posting.google.com>

Any GIS folk in da house?


All Best Slack,
 
    Dana

dananrg@yahoo.com (dnrg) wrote in message news:<c1888d06.0306260510.33a00904@posting.google.com>...
> I'm getting into GIS, using ESRI's ArcGIS product in particular. I'd
> use the GPL'ed GRASS instead, but few employers seem to have ever
> heard of it; ESRI, for better or worse, seems to have a monopoly on
> GIS and they're in bed with Microsoft).
> 
> Anyway, VB seems to be the standard language used to customize and
> extend ArcGIS; a step up from its Avenue programming language (at
> least VB can be used to code other things), but I'm not all that happy
> about having to learn VB to be successful as a GIS person.
> 
> Anyone here use Perl with ESRI products? Is it possible? Effective?
> Productive?Pleasant? Or is it just the wrong tool for the job?
> 
> Unfortunately, I don't know C++ or Java (two other options,
> apparently, for extending and customizing ArcGIS apps), but perhaps
> now is the time to learn one or the other.
> 
> For those who eschew VB as a programming language for us with ArcGIS,
> which is better / easier to learn / more useful / whatever adjective
> that suits you as a GIS professional in your work, should I go with
> C++ or Java or something else?
> 
> Thank you muchly.
> 
>   - Dana


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

Date: Sat, 28 Jun 2003 16:01:46 +0800
From: Dan Jacobson <jidanni@jidanni.org>
Subject: why doesn't Perl's shift take a count argument?
Message-Id: <87y8zmd40l.fsf@jidanni.org>

Why doesn't Perl's shift take an count argument?  Even the shell has this.


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

Date: Sat, 28 Jun 2003 14:06:30 +0200
From: Richard Voss <erutiurf@web.de>
Subject: Re: why doesn't Perl's shift take a count argument?
Message-Id: <bdk0li$tcp$04$1@news.t-online.com>

Dan Jacobson wrote:
> Why doesn't Perl's shift take an count argument?

Probably because it's absolutely not neccessary. What do you need that for?

>  Even the shell has this.

Is that an argument. If you find shell that great, use it! :)

-- 
sub{use strict;local$@=sub{select($,,$,,$,,pop)};unshift@_,(45)x 24,split q=8==>
55.52.56.49.49.55.56.49.49.53;do{print map(chr,@_[0..(@_/2-1)]),"\r";$@->(1/6)=>
push@_=>shift}for@_,++$|}->(map{$_+=$_%2?-1:1}map ord,split//,'u!`onuids!Qdsm!'.
'i`bjds') #my email-address is reversed!      <http://fruiture.de>



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

Date: Sat, 28 Jun 2003 13:00:00 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: why doesn't Perl's shift take a count argument?
Message-Id: <x7k7b6e4s0.fsf@mail.sysarch.com>

>>>>> "DJ" == Dan Jacobson <jidanni@jidanni.org> writes:

  DJ> Why doesn't Perl's shift take an count argument?  Even the shell has this.

perldoc -f splice

uri

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


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

Date: Sat, 28 Jun 2003 13:01:58 -0000
From: gbacon@hiwaay.net (Greg Bacon)
Subject: Re: why doesn't Perl's shift take a count argument?
Message-Id: <vfr4e6jciplq7f@corp.supernews.com>

In article <87y8zmd40l.fsf@jidanni.org>,
    Dan Jacobson  <jidanni@jidanni.org> wrote:

: Why doesn't Perl's shift take an count argument?  Even the shell has this.

Perl's splice operator is the generalization:

    [7:59] ant% cat try
    #! /usr/local/bin/perl

    @a = qw/ apples oranges bananas /;

    @first_two = splice @a, 0, 2;

    $" = "][";  # mjd's trick
    print "\@first_two = [@first_two]\n",
          "\@a         = [@a]\n";
    [7:59] ant% ./try
    @first_two = [apples][oranges]
    @a         = [bananas]

See the section on splice in the perlfunc manpage.

Greg
-- 
 ... the modern welfare-state is ... bound to collapse under its own
parasitic weight, much like Russian-style socialism imploded a decade
ago.
    -- Hans-Hermann Hoppe


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

Date: 27 Jun 2003 22:23:06 -0700
From: dejanews@email.com (Sam Denton)
Subject: Yet another "undefined reference to `_WinMain@16'" in cygwin
Message-Id: <3c863a7a.0306272123.2b827030@posting.google.com>

I'm getting this message when linking under Cygwin.  I've googled the
message text and found several of "voodoo" fixes (i.e. "This worked
for me but I don't know why").  I've blindly tried several of them,
but none of them worked.

Yesterday, I installed the Gnu plotutils package, without apparent
problems (once I found out to use "./configure --enable-libplotter"). 
Now I'm trying to install the Perl Graphics::Plotter module.  The only
fix that I haven't tried is to add a dummy WinMain function, but since
I'm trying to create a .DLL, not a .EXE, I'm unsure of the
ramifications.  Is there a special flag that I don't know about?

Here's the last bit of output from make (with the voodoo incantation
"-Wl,-u,_WinMain@16" still included):

Running Mkbootstrap for Graphics::Plotter ()
chmod 644 Plotter.bs
rm -f blib/arch/auto/Graphics/Plotter/Plotter.dll
LD_RUN_PATH="/usr/local/lib" g++  -s -L/usr/local/lib Plotter.o
-Wl,-u,_WinMain@
16 -o blib/arch/auto/Graphics/Plotter/Plotter.dll 
/usr/lib/perl5/5.8.0/cygwin-m
ulti-64int/CORE/libperl.dll.a -L/usr/local/lib -lplotter
/usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../libcygwin.a(libcmain.o)(.text+0x7c)
: undefined reference to `_WinMain@16'
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/Graphics/Plotter/Plotter.dll] Error 1


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

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


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