[28110] in Perl-Users-Digest
Perl-Users Digest, Issue: 9474 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 14 21:05:44 2006
Date: Fri, 14 Jul 2006 18:05:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 14 Jul 2006 Volume: 10 Number: 9474
Today's topics:
=?iso-8859-1?Q?Re:_Re:_Encoding_of_the_perl_output_=28= <benkasminbullock@gmail.com>
Dirty movie list program robic0
Re: Encoding of the perl output (á é í ó) robic0
Re: finding perl info on google can be hard <tadmc@augustmail.com>
Re: finding perl info on google can be hard <benkasminbullock@gmail.com>
Re: finding perl info on google can be hard robic0
Re: glob and Traverse Directory robic0
Re: Hash <nobull67@gmail.com>
Re: Hash <1usa@llenroc.ude.invalid>
Re: Interfacing with Matlab using Win32::OLE <benmorrow@tiscali.co.uk>
Re: Interfacing with Matlab using Win32::OLE <fleming.scott@gmail.com>
Re: matching only alphabetic chars and only digits with <rvtol+news@isolution.nl>
Re: matching only alphabetic chars and only digits with <benmorrow@tiscali.co.uk>
Re: Perl and Politics robic0
Re: Perl and Politics ilikesluts@gmail.com
Re: Perl and Politics robic0
Re: some help again with if statement <benkasminbullock@gmail.com>
Re: some help again with if statement robic0
Re: Traverse a directory <1usa@llenroc.ude.invalid>
Re: Traverse a directory <tadmc@augustmail.com>
Re: What is a type error? <jo@durchholz.org>
Re: What is a type error? <cdsmith@twu.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 15 Jul 2006 09:19:33 +0900
From: "Ben Bullock" <benkasminbullock@gmail.com>
Subject: =?iso-8859-1?Q?Re:_Re:_Encoding_of_the_perl_output_=28=E1_=E9_=ED_=F3=29?=
Message-Id: <e99caj$cnp$1@ml.accsnet.ne.jp>
"Alan J. Flavell" <flavell@physics.gla.ac.uk> wrote in message
news:Pine.LNX.4.64.0607122007220.9658@ppepc20.ph.gla.ac.uk...
> On Tue, 11 Jul 2006, Ben Bullock wrote:
>
>> "Alan J. Flavell" <flavell@physics.gla.ac.uk> wrote in message
>> > On Mon, 10 Jul 2006, Ben Bullock wrote:
>> > > and the problem is not Perl but that the
>> > > browser encoding is not set properly.
>> >
>> > Well, the proper place to set the character encoding for a browser is
>> > from the document source - rather than being set in the browser by the
>> > recipient, which is at best a workaround or repair technique.
>>
>> Some other people (I see the names Sherm Pendley and Reto) already
>> made extensive posts about how to fix the encoding, but no-one
>> seemed to have mentioned that the supposedly incorrect output from
>> Perl was actually correct utf8.
>
> Really? I thought that you did:
>
>> > > and the problem is not Perl but that the
>> > > browser encoding is not set properly.
>
> But when Perl has emitted a (correctly encoded) document, and sent it
> to some browser, the browser has no inherent idea of which character
> encoding was being used by Perl for its output: the point of my
> followup was to stress that this needs to be done, and suggesting the
> various ways that are available. By all means it was off-topic for a
> strictly Perl agenda, but it was part of the actual problem.
>
> On the other hand, if one wants effective control over the character
> encoding that Perl will emit, then Sherm's posting is relevant. (And
> on-topic ;-)
>
> Hope that addresses your concerns.
Sorry, what is your point?
------------------------------
Date: Fri, 14 Jul 2006 15:45:00 -0700
From: robic0
Subject: Dirty movie list program
Message-Id: <rb7gb2hia5ona20sadr3o38li40pjg6b51@4ax.com>
For the collectors...
Enjoy
robic0
==============================
use strict;
use warnings;
my ($max_lpp,$cnt,$item,$hdr,$ltr_last) = (50,1,1,"\n\n",undef);
my $movie_files = "C:\\DVD_Cover_Images\\*.*";
my $movie_list_out = "c:\\movielist.txt";
open MLIST, ">$movie_list_out" || die "can't open $movie_list_out";
foreach (glob ($movie_files)) {
if (/.+\\(.+)(\..*)$/)
{
my $movie = filter_movie_title($1);
if (length($movie)) {
my $stmp = sprintf ("%5s %s\n", $item, $movie);
my $ltr1 = substr $movie,0,1;
my $ltr2 = substr $movie,1,1;
$ltr2 = '' unless defined $ltr2;
$ltr1 = uc($ltr1);
$ltr2 = uc($ltr2);
if (!defined $ltr_last) {
print MLIST " "x65,"$ltr1$ltr2\n$hdr";
print MLIST " "x10,"- $ltr1 -\n\n";
$cnt = 3;
}
elsif ($ltr1 ne $ltr_last) {
print MLIST "\n"," "x10,"- $ltr1 -\n\n" if (($cnt+3) <= $max_lpp);
$cnt += 3;
}
if ($cnt > $max_lpp) {
print MLIST "\f"," "x65,"$ltr1$ltr2\n$hdr";
$cnt = 1;
if ($ltr1 ne $ltr_last) {
print MLIST " "x10,"- $ltr1 -\n\n";
$cnt += 2;
}
}
print $stmp;
print MLIST $stmp;
$cnt++;
$item++;
$ltr_last = $ltr1;
}
}
}
close MLIST;
print "\nMovie list input: $movie_files\n";
print "Movie list output: $movie_list_out\n";
sub filter_movie_title
{
my $title = shift;
## add some title filters
$title =~ s/_/ /g;
$title =~ s/-front//gi;
return $title;
}
__END__
------------------------------
Date: Fri, 14 Jul 2006 17:31:44 -0700
From: robic0
Subject: Re: Encoding of the perl output (á é í ó)
Message-Id: <6cdgb2papg78edra7ter4rgnoou0ctv29l@4ax.com>
On Sat, 15 Jul 2006 09:19:33 +0900, "Ben Bullock" <benkasminbullock@gmail.com> wrote:
>
>"Alan J. Flavell" <flavell@physics.gla.ac.uk> wrote in message
>news:Pine.LNX.4.64.0607122007220.9658@ppepc20.ph.gla.ac.uk...
>> On Tue, 11 Jul 2006, Ben Bullock wrote:
>>
>>> "Alan J. Flavell" <flavell@physics.gla.ac.uk> wrote in message
>>> > On Mon, 10 Jul 2006, Ben Bullock wrote:
>>> > > and the problem is not Perl but that the
>>> > > browser encoding is not set properly.
>>> >
>>> > Well, the proper place to set the character encoding for a browser is
>>> > from the document source - rather than being set in the browser by the
>>> > recipient, which is at best a workaround or repair technique.
>>>
>>> Some other people (I see the names Sherm Pendley and Reto) already
>>> made extensive posts about how to fix the encoding, but no-one
>>> seemed to have mentioned that the supposedly incorrect output from
>>> Perl was actually correct utf8.
>>
>> Really? I thought that you did:
>>
>>> > > and the problem is not Perl but that the
>>> > > browser encoding is not set properly.
>>
>> But when Perl has emitted a (correctly encoded) document, and sent it
>> to some browser, the browser has no inherent idea of which character
>> encoding was being used by Perl for its output: the point of my
>> followup was to stress that this needs to be done, and suggesting the
>> various ways that are available. By all means it was off-topic for a
>> strictly Perl agenda, but it was part of the actual problem.
>>
>> On the other hand, if one wants effective control over the character
>> encoding that Perl will emit, then Sherm's posting is relevant. (And
>> on-topic ;-)
>>
>> Hope that addresses your concerns.
>
>Sorry, what is your point?
Little late to the party but from what's gleened here:
I believe that document rendering is the job of the stream interpreter. Should the
stream be interpreted as Unicode then it will display properly. File to file
editing is as read (posibly converted, but the downstream renderer must know which
characterset to derive the bitmap from) and written.
There can be noone ambiguity here. You can view the same binary, bitmapped rendered
to anything you like. How can this be confusing?
robic0
------------------------------
Date: Fri, 14 Jul 2006 18:09:06 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: finding perl info on google can be hard
Message-Id: <slrnebg90i.33j.tadmc@magna.augustmail.com>
ilikesluts@gmail.com <ilikesluts@gmail.com> wrote:
> I want to be a good forum member and would
> appreciate the oppertunity to improve my netiquette.
Then stop top-posting already!
[snip rancid TOFU]
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 15 Jul 2006 09:27:20 +0900
From: "Ben Bullock" <benkasminbullock@gmail.com>
Subject: Re: finding perl info on google can be hard
Message-Id: <e99cp6$cnr$1@ml.accsnet.ne.jp>
"Paul Lalli" <mritty@gmail.com> wrote in message
news:1152906125.740069.16180@s13g2000cwa.googlegroups.com...
> Count to ten, review this thread, and consider exactly who is being
> more troll-like.
I don't know who is being more troll-like but I really don't see why people
on this newsgroup so consistently attack new posters with rude remarks.
Would it hurt everyone here to try to at least be polite when asking people
to follow posting guidelines, and try to see the other person's point of
view? At least half of the threads here seem to end in some kind of fight,
and to me the fairly extreme rudeness of many of the established posters is
the obvious cause of the problems.
------------------------------
Date: Fri, 14 Jul 2006 17:42:54 -0700
From: robic0
Subject: Re: finding perl info on google can be hard
Message-Id: <sudgb2t91rkfqiccrrlea97tm5t5okomom@4ax.com>
On Sat, 15 Jul 2006 09:27:20 +0900, "Ben Bullock" <benkasminbullock@gmail.com> wrote:
>
>"Paul Lalli" <mritty@gmail.com> wrote in message
>news:1152906125.740069.16180@s13g2000cwa.googlegroups.com...
>
>> Count to ten, review this thread, and consider exactly who is being
>> more troll-like.
>
>I don't know who is being more troll-like but I really don't see why people
>on this newsgroup so consistently attack new posters with rude remarks.
>Would it hurt everyone here to try to at least be polite when asking people
>to follow posting guidelines, and try to see the other person's point of
>view? At least half of the threads here seem to end in some kind of fight,
>and to me the fairly extreme rudeness of many of the established posters is
>the obvious cause of the problems.
Well now wait a minute. What seems to you as rudeness is just the heritage here.
Its the tradition. Lalli and McLelland are the traditionalists here. They cannot
change the ng tradition. To do so would be a missing second in time, a lost
heart beat, a day without sunshine, a day without beating the wife.
You may be polite here but this isn't the ng for it. The rudeness is a
necessary evil, it masks doubt and insecurity when questions go beyond a
level that can be confidently responded to. These fellows never utter the
"I don't know phrase". Its a deathblow when they wear their consulting signatures.
Good luck partner
robic0
------------------------------
Date: Fri, 14 Jul 2006 16:53:45 -0700
From: robic0
Subject: Re: glob and Traverse Directory
Message-Id: <dbbgb2p9tudpo72708paugim45vvuhlcii@4ax.com>
On 14 Jul 2006 14:31:04 -0700, "weberw@adelphia.net" <weberw@adelphia.net> wrote:
>Yes paul.
>Paul Lalli wrote:
>> weberw@adelphia.net wrote:
>> > In Perl , When I am traversing through a directory of files and I want
>> > to create an html link when the file extension is .html how would you
>> > do this?
>>
>> I would write a Perl program to do it for me.
>>
>> How have you tried to do it?
>>
>> Paul Lalli
Well lets see here. Apparently finding *.html in a directory is alot
easier than creating a link. 50/50. Where does the link go? E-mail,
a web page from a cgi, asp, a Word doc? What good is semi-automation?
robic0
------------------------------
Date: 14 Jul 2006 15:18:09 -0700
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: Hash
Message-Id: <1152915489.657137.10940@75g2000cwc.googlegroups.com>
weberw@adelphia.net wrote:
> How do I make the current letters appear in this version of hangman?
>
>
> $current{word} = $cat
>
> When the user enters c. I need it show c_ _.
>
> sub processguess{
>
>
> #hash of letters guessed
> $current{letters} .= param('guess');
Perl cannot read comments.
$current{letters} in the above is just a string/
Ig you want it to be a hash then ypu need to treat it as one. By the
magic of DWIM simply treating it as a hash will make it one.
$current{letters}{param('guess')}++;
> @guessed_letters = split('', $current{letters});
> $current{letters} = join('', @guessed_letters);
What do you think the above lines do?
> return $current{'letters'};
What is ther purpose of this random statement?
> my @word = split / /, $current{word};
> $current{'revealed'} = join '',map {$current{letters}{$_} ? $_ : '_' }
> $current{word} =~ /(.)/g;
> return $current{'revealed'};
> }
You should always use the most natural represtations of things unless
there is a reason not to. A temporary scalar value used within a
subroutine is a lexically scoped scalar variable, not an element of a
hash - $current{'revealed'}.
Please unless you actually enjoy pain, use strict and warnings.
If youm _do_ enjoy pain pleas do so in private, don't share it with the
rest of us.
------------------------------
Date: Fri, 14 Jul 2006 22:34:56 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Hash
Message-Id: <Xns9800BD204F2F4asu1cornelledu@127.0.0.1>
"weberw@adelphia.net" <weberw@adelphia.net> wrote in
news:1152912490.373506.252910@m73g2000cwd.googlegroups.com:
> How do I make the current letters appear in this version of hangman?
The code you posted below is unreadable. IIRC, you have already posted
here before, and you ought to know about the guidelines.
So, here's my solution: I'll post a quick and dirty hangman, you can do
whatever you want with it, but I won't be seeing you again:
#!/usr/bin/perl
use strict;
use warnings;
use List::MoreUtils qw( pairwise );
$| = 1;
use constant GUESSES => 10;
my ($secret) = @ARGV;
$secret = 'hangman' unless defined $secret;
my @secret = split //, $secret;
my %secret = map { $_ => 1 } @secret;
my %guesses;
my $won;
GUESS: for my $guess_n (1 .. GUESSES) {
print make_prompt(), ': Enter a letter or word: ';
my $guess = <STDIN>;
$guess =~ s/\s+$//;
if ( length $guess == 1 ) {
$guesses{$guess} = 1;
if ( check_win( keys %secret, keys %guesses) ) {
$won = 1;
last GUESS;
}
}
elsif ( $guess eq $secret ) {
$won = 1;
%guesses = map { $_ => 1 } split //, $guess;
last GUESS;
}
}
if ( $won ) {
print make_prompt(), " : You won!\n";
}
else {
print "You lost!\nThe word was: $secret\n";
}
sub make_prompt {
join(' ',
map { exists $guesses{ $_ } ? $_ : '_' } @secret,
);
}
sub check_win {
my %check;
++ $check{ $_ } for @_;
keys %check == grep { $check{ $_ } == 2 } keys %check;
}
__END__
D:\UseNet\clpmisc> hangman.pl guidelines
_ _ _ _ _ _ _ _ _ _: Enter a letter or word: g
g _ _ _ _ _ _ _ _ _: Enter a letter or word: u
g u _ _ _ _ _ _ _ _: Enter a letter or word: d
g u _ d _ _ _ _ _ _: Enter a letter or word: i
g u i d _ _ i _ _ _: Enter a letter or word: e
g u i d e _ i _ e _: Enter a letter or word: s
g u i d e _ i _ e s: Enter a letter or word: l
g u i d e l i _ e s: Enter a letter or word: n
g u i d e l i n e s : You won!
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Fri, 14 Jul 2006 23:18:47 +0100
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: Interfacing with Matlab using Win32::OLE
Message-Id: <7rhlo3-vko.ln1@osiris.mauzo.dyndns.org>
Quoth "scottmf" <fleming.scott@gmail.com>:
> I am not sure if this is more of an issue with Matlab or Perl, but here
> is what I am having trouble doing:
> I want a user to be able to start Matlab (on a WinXP machine) and run a
> matlab program like perl_link.m below that runs a perl script. The
> perl script then parses a large data file and stores the results in
> several arrays in matlab using OLE objects. The rest of the matlab
> program then processes those arrays. I have been able to get the
> perl->matlab OLE interface work if I start matlab from within the perl
> script using
>
> $ML = Win32::OLE->new('Matlab.Application', sub {$_[0]->Quit;})
> or die "Oops, cannot start MATLAB";
>
> But I cannot find the matlab OLE object if I start matlab first and run
> the perl script from inside matlab.
>
<perl script run from within matlab>
> #!/usr/bin/perl -w
> #
> use strict;
> use warnings;
> use Win32::OLE;
> use Win32::OLE::Variant;
>
> my $Count;
> $Count = Win32::OLE->EnumAllObjects(sub {
> my $Object = shift;
> my $Class = Win32::OLE->QueryObjectType($Object);
> printf "# Object=%s Class=%s\n", $Object, $Class;
> });
> print "Found $Count OLE Object(s)\n";
I'm fairly sure you still need the Win32::OLE->new line. If matlab is
running it should give you a handle on the current instance. [Caveat: my
understanding of OLE is sketchy at best :)]
The Perl program is in no sense 'inside' matlab. It is a completely
separate process: it doesn't even know you invoked it from matlab, so
how would you get an OLE object?
As Sinan said, it may be easier not to bother with OLE. Does matlab have
a function to import, say, a CSV file? I would probably start along that
route: write a CSV file with the data you want in Perl, and then import
it into matlab from the matlab macro.
Ben
--
Razors pain you / Rivers are damp
Acids stain you / And drugs cause cramp. [Dorothy Parker]
Guns aren't lawful / Nooses give
Gas smells awful / You might as well live. benmorrow@tiscali.co.uk
------------------------------
Date: 14 Jul 2006 16:25:25 -0700
From: "scottmf" <fleming.scott@gmail.com>
Subject: Re: Interfacing with Matlab using Win32::OLE
Message-Id: <1152919524.917427.322710@75g2000cwc.googlegroups.com>
> I'm fairly sure you still need the Win32::OLE->new line. If matlab is
> running it should give you a handle on the current instance. [Caveat: my
> understanding of OLE is sketchy at best :)]
>
> The Perl program is in no sense 'inside' matlab. It is a completely
> separate process: it doesn't even know you invoked it from matlab, so
> how would you get an OLE object?
when I use the Win32::OLE->new line it launches a new instance of
matlab rather than linking to the current instance. I think this is
the basic problem; that I need some way to link the perl script to the
current matlab instance.
> As Sinan said, it may be easier not to bother with OLE. Does matlab have
> a function to import, say, a CSV file? I would probably start along that
> route: write a CSV file with the data you want in Perl, and then import
> it into matlab from the matlab macro.
Matlab does have a csv inport function, and this process would work,
but it seems like there is some way to link the two that I just haven't
found yet. I perfer to avoid writing and then deleting temp files when
it is not absolutely necessary...
Thanks for the suggestions
~Scott
------------------------------
Date: Fri, 14 Jul 2006 23:57:19 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: matching only alphabetic chars and only digits with periods
Message-Id: <e99b1d.e0.1@news.isolution.nl>
Jack schreef:
> I am trying to match ONLY alphabetic chars [...]
>
> $temp = '14.5a';
> if ($temp =~ m/\D+/ and $temp !~ m/\d+/) { print " alpha "; }
>
> Only matches NONDIGITS... ? # . is a non digit but not
> alphabetic.. how do I test for pure alphabetic ?
You should get to know anchors, like ^and $, or \A and \z. See `perldoc
perlre`.
The regex
/\A [[:alpha:]]+ \z/x
will only match non-empty strings with only alphabetic characters.
> Likewise, how do I test for pure numeric dollar amount with a "period"
> in them "."
Check out Regexp::Common.
http://search.cpan.org/search?module=Regexp::Common
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Fri, 14 Jul 2006 23:22:16 +0100
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: matching only alphabetic chars and only digits with periods
Message-Id: <o1ilo3-vko.ln1@osiris.mauzo.dyndns.org>
Quoth no@email.com:
> Jack wrote:
>
> > Hi I am trying to match ONLY alphabetic chars (not digits or anything
> > else)..
> >
> > I am finding that
> >
> > $temp = '14.5a';
> > if ($temp =~ m/\D+/ and $temp !~ m/\d+/) { print " alpha "; }
> >
> > Only matches NONDIGITS... ? # . is a non digit but not alphabetic..
> > how do I test for pure alphabetic ?
>
> m/^[a-zA-Z]+$/
No! You will miss all locale-specific and Unicode alphabetics, and it
won't work at all on non-ASCII machines. Just say what you mean:
/[[:alpha:]]/
Ben
--
Joy and Woe are woven fine,
A Clothing for the Soul divine William Blake
Under every grief and pine 'Auguries of Innocence'
Runs a joy with silken twine. benmorrow@tiscali.co.uk
------------------------------
Date: Fri, 14 Jul 2006 16:43:28 -0700
From: robic0
Subject: Re: Perl and Politics
Message-Id: <ulagb2lc8gcfofhflm6s6dp92cpjn0memu@4ax.com>
On 14 Jul 2006 13:58:55 -0700, ilikesluts@gmail.com wrote:
>Hi Anno,
>I don't like trolls either but I can't help but think that you are
>suggesting that I am a troll. Is that what you saying? If so please
>be forthright and straight forward. I think that being straight
>forward is the basis of good communications and good communications
>goes a long way to reducing troll like behaviors on message boards.
>
>anno4000@radom.zrz.tu-berlin.de wrote:
>> One consensus would be that trolls are assholes.
>>
>> Anno
I'm pretty sure you assume trolls don't/can't communicate.
If you have a newsreader with a list control you can actually
view the trolls when you list by author. Collectively, they post %70 of the
messages here. That is the band of troll's who live here. The math of
extrapolation is left as an exercise. Theres about 4 or 5 that share the crown.
robic0
------------------------------
Date: 14 Jul 2006 16:55:05 -0700
From: ilikesluts@gmail.com
Subject: Re: Perl and Politics
Message-Id: <1152921305.041521.28350@m73g2000cwd.googlegroups.com>
Hi robic,
The point that I wanted to make was that straight talk is part of a
respectful environment and a respectful environment is good for normal
people. That's my take anyways.
I think you are right about this board. I don't think I'm going to
make it a regular stop on my information super highway.
robic0 wrote:
> I'm pretty sure you assume trolls don't/can't communicate.
> If you have a newsreader with a list control you can actually
> view the trolls when you list by author. Collectively, they post %70 of the
> messages here. That is the band of troll's who live here. The math of
> extrapolation is left as an exercise. Theres about 4 or 5 that share the crown.
>
> robic0
------------------------------
Date: Fri, 14 Jul 2006 16:59:55 -0700
From: robic0
Subject: Re: Perl and Politics
Message-Id: <3ubgb2pnaqv2a2ksh119c2jaoqarms7bej@4ax.com>
On 14 Jul 2006 16:55:05 -0700, ilikesluts@gmail.com wrote:
[snip]
>The point that I wanted to make was that straight talk is part of a
>respectful environment and a respectful environment is good for normal
>people. That's my take anyways.
>
[snip]
Wrong ng partner
robic0
------------------------------
Date: Sat, 15 Jul 2006 09:33:09 +0900
From: "Ben Bullock" <benkasminbullock@gmail.com>
Subject: Re: some help again with if statement
Message-Id: <e99d47$crv$1@ml.accsnet.ne.jp>
"J$B!&(Bgen Exner" <jurgenex@hotmail.com> wrote in message
news:kABtg.8893$Zf.1086@trnddc04...
> starfrit wrote:
>> First, you don't have to be so rude, your little points are very
>> agressive,
>
> Who is "you"? What are you referring to?
> Please quote appropriate context -as has been customary for 2 decades-
> such that people have a chance to know what you are talking about.
>
>> and second, I'm a professional IT, not a newb.
>
>
> Oh, really? And you can't distinguish between a problem with an if
> statement and a regular expression match?
> Interesting.
That's a nice example of "extreme rudeness".
------------------------------
Date: Fri, 14 Jul 2006 17:49:33 -0700
From: robic0
Subject: Re: some help again with if statement
Message-Id: <4oegb29b8emu6f96btv7rmcbcqiv2v4r1t@4ax.com>
On Sat, 15 Jul 2006 09:33:09 +0900, "Ben Bullock" <benkasminbullock@gmail.com> wrote:
>
>"J?gen Exner" <jurgenex@hotmail.com> wrote in message
>news:kABtg.8893$Zf.1086@trnddc04...
>> starfrit wrote:
>>> First, you don't have to be so rude, your little points are very
>>> agressive,
>>
>> Who is "you"? What are you referring to?
>> Please quote appropriate context -as has been customary for 2 decades-
>> such that people have a chance to know what you are talking about.
>>
>>> and second, I'm a professional IT, not a newb.
>>
>>
>> Oh, really? And you can't distinguish between a problem with an if
>> statement and a regular expression match?
>> Interesting.
>
>That's a nice example of "extreme rudeness".
Oh yea, lets pick on the IT professionals. IT pro's have job security,
consultants (an wannbe ones) have short and poor lives.
Expect it here. Welcome to the ng partner
robic0
------------------------------
Date: Fri, 14 Jul 2006 22:36:33 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Traverse a directory
Message-Id: <Xns9800BD668F03Dasu1cornelledu@127.0.0.1>
"weberw@adelphia.net" <weberw@adelphia.net> wrote in
news:1152914623.265443.4470@p79g2000cwp.googlegroups.com:
> Paul-thanks for the tips of posting guidelines. Wasn't aware of this
> before. Anyway. I tried the skip dir that you mentioned and
> unfortunately it does skip the folder but still includes the contents
> of the folder.
> Paul Lalli
Be careful when you are quoting. The way you did it above makes it look
like Paul Lalli wrote the text above. He didn't.
*PLONK*
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Fri, 14 Jul 2006 18:06:13 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Traverse a directory
Message-Id: <slrnebg8r5.33j.tadmc@magna.augustmail.com>
weberw@adelphia.net <weberw@adelphia.net> wrote:
> Tad- return if /folder 3/; still included the files inside the
> folder 3 so it didn't work. It did exclude folder 3 but the contents
> of folder 3 were displayed.
return if $File::Find::name =~ /folder 3/;
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 15 Jul 2006 00:00:31 +0200
From: Joachim Durchholz <jo@durchholz.org>
Subject: Re: What is a type error?
Message-Id: <e994ev$lj6$1@online.de>
Marshall schrieb:
> Joachim Durchholz wrote:
>> You can have aliasing without pointers; e.g. arrays are fully sufficient.
>> If i = j, then a [i] and a [j] are aliases of the same object.
>
> I am having a hard time with this very broad definition of aliasing.
> Would we also say that a[1+1] and a[2] are aliases? It seems
> to me, above, that we have only a, and with only one variable
> there can be no aliasing.
a[1] is a variable, too. You can assign values to it.
Inside function foo when called as foo(a[1]), it may even be referenced
with yet another name and updated in isolation; foo may not even know
it's an array element. (This is sort-of true in C, and definitely true
in languages that don't have pointer arithmetic. If you pass a[1] to a
call-by-reference parameter in Pascal, the callee has no way to access
the parameter as if it were an array element.)
> A further question:
>
> given a 32 bit integer variable x, and offsets i and j (equal as in
> the above example) would you say that
>
> x &= (1 << i)
> and
> x &= (1 << j)
>
> are aliased expressions for setting a particular bit in x?
Yes.
> I am not being facetious; I am trying to understand the limits
> of your definition for aliasing.
Understood and appreciated.
>> (After I observed that, I found it no longer a surprise that array
>> optimizations are what Fortran compiler teams sink most time into. The
>> aliasing problems are *exactly* the same as those with pointers in C -
>> though in practice, the Fortranistas have the advantage that the
>> compiler will usually know that a [i] and b [j] cannot be aliases of
>> each other, so while they have the same problems, the solutions give the
>> Fortranistas more leverage.)
>
> I don't understand this paragraph. On the one hand, it seems you
> are saying that C and Fortran are identically burdened with the
> troubles caused by aliasing, and then a moment later it seems
> you are saying the situation is distinctly better with Fortran.
That's exactly the situation.
Aliasing is present in both language, but in Fortran, the guarantee that
two names aren't aliased are easier to come by.
Even more non-aliasing guarantees exist if the language has a more
expressive type system. In most cases, if you know that two expressions
have different types, you can infer that they cannot be aliases.
Of course, the life of compiler writers if of less importance to us; I
added them only because the reports of Fortran compilers having aliasing
problems due to array indexes made me aware that pointers aren't the
only source of aliasing. That was quite a surprise to me then.
> Now with this, it appears you are agreeing that SQL has an advantage
> vis-a-vis aliasing compared to OO languages. Yes?
Sure.
I think that making an aliasing bug in SQL is just as easy as in any
pointer-ridden language, but transactions and constraints (plus the
considerably smaller typical size of SQL code) make it far easier to
diagnose any such bugs.
> If so, we are agreeing on the part I care about, and the specifics of
> just what we call aliasing are not so important to me.
I'm not sure whether I'm getting the same mileage out of this, but the
relevance of a problem is obviously a function on what one is doing on a
day-to-day basis, so I can readily agree with that :-)
Regards,
Jo
------------------------------
Date: Fri, 14 Jul 2006 18:54:12 -0600
From: Chris Smith <cdsmith@twu.net>
Subject: Re: What is a type error?
Message-Id: <MPG.1f21ea9e2a3f19ee989687@news.altopia.net>
Marshall wrote...
> I am having a hard time with this very broad definition of aliasing.
> Would we also say that a[1+1] and a[2] are aliases? It seems
> to me, above, that we have only a, and with only one variable
> there can be no aliasing.
The problem with this (and with the relational one as well) is that the
practical problems don't go away by redefining "variable" to mean larger
collections of values.
> given a 32 bit integer variable x, and offsets i and j (equal as in
> the above example) would you say that
>
> x &= (1 << i)
> and
> x &= (1 << j)
>
> are aliased expressions for setting a particular bit in x?
I don't know about Joachim, but yes, I would.
--
Chris Smith - Lead Software Developer / Technical Trainer
MindIQ Corporation
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 9474
***************************************