[28482] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9846 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 14 00:05:53 2006

Date: Fri, 13 Oct 2006 21:05:04 -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, 13 Oct 2006     Volume: 10 Number: 9846

Today's topics:
        I have no problems eating cereal...after it softens. Wh samiam@mytrashmail.com
    Re: I have no problems eating cereal...after it softens samiam@mytrashmail.com
    Re: I have no problems eating cereal...after it softens <tadmc@augustmail.com>
    Re: I have no problems eating cereal...after it softens <wahab@chemie.uni-halle.de>
    Re: iPod Smart Playlist, iTunes, skip count, play count <solitude.standing@silent-force.info>
    Re: Primal Script/Komodo/ASE vs Ultra Edit users: With  samiam@mytrashmail.com
    Re: Primal Script/Komodo/ASE vs Ultra Edit users: With  samiam@mytrashmail.com
    Re: Primal Script/Komodo/ASE vs Ultra Edit users: With  <sbryce@scottbryce.com>
    Re: Primal Script/Komodo/ASE vs Ultra Edit users: With  <wahab@chemie.uni-halle.de>
    Re: Probs with nested conditions <ced@blv-sam-01.ca.boeing.com>
    Re: using the first variable on the command line inside <tadmc@augustmail.com>
    Re: using the first variable on the command line inside <john@castleamber.com>
    Re: using the first variable on the command line inside <john@castleamber.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 13 Oct 2006 17:12:26 -0700
From: samiam@mytrashmail.com
Subject: I have no problems eating cereal...after it softens. Why is replacing a simple string so hard then?
Message-Id: <1160784746.500059.234150@e3g2000cwe.googlegroups.com>


In other areas of my life, like eating oatmeal and getting dressed, I
have no real problems. Some might even say I am a savant.

But I am just beginning Perl, and things I think are easy turn out not
to me. Now, (said in Scarface voice) Let me introduce you to my lil'
friend!

My task is sooo deceptively simple: Just replace a simple string with
another string. How hard could that be?

My data file is here: http://home.comcast.net/~tankomail/preg.htm
And a sample is at the very bottom of this post. I just want to replace
/<form[.*]?*\/form>/ with the word "block"

Basically I just want to replace all <form> </form> fields and
everything in between with nothing, but in testing, I wanted to see my
work so I chose the word "block" as a good simple substitute which I
could then replace with nothing.

Way Below is my base code. But here, just under is the pulled line from
the base code that seems to be the issue:
$orgtext = Whey;  # this one right here
$newtext = Popcorn;

The above works. I reduced it to it's simplest form as a sanity check.
Then I tried:

$orgtext = /[Ww]hey/;  # this one right here
$newtext = Popcorn;

But beyond the most primitive replacement, I invariably get:

Use of uninitialized value in pattern match (m//) at
C:\russ\scripts\_Master_Snippets\clean_2_input_output_file.pl line 9.

Eventually I want to try:

$orgtext = /<form[.*]?*\/form>/;  # this one right here
$newtext = block;

But I can't get past the staring blocks. I know this code works in
general, but my modifications seem to break it.

I also tried some while (<$intext>) variations, even removing the undef
$/ slurp line, so that the intext would receive the data line by line -
but no luck anywhere. I have spent quite a bit of research time trying
various things - but apparently it's not a trivial task.

Any suggestions as to:

1.) Is my basic model okay, slurping the whole file into a variable? or
2.) Should I use a while <> structure?

And even when I do get the simple Whey replaced with Popcorn - it only
does the first instance, basically, I am guessing, because there is no
iterative code in this script. And the only iterative examples I've
seen are not with a whole file in one "intext" variable, but always
with a while <> structure.

Your input and examples are GREATLY appreciated because the red spot on
my banging against the cubicle wall head is growing.

L,
Sam

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

Here is my base code.

$infile = 'C:\russ\weights\preg.htm';
$outfile = 'C:\russ\weights\preg_clean.htm';

# No, I am not pregnant, but I am helping a pregnant woman out!
No...not just helping her get
# her start either :)

$orgtext = Whey;
$newtext = Popcorn;

undef $/; #slurp mode, read files in a whole

open IN, $infile or die $!;
$intext = <IN>;
close IN;

$intext =~ s/$orgtext/$newtext/ms;
# the ms is for coping correctly with newlines (that can easily appear
in a binary).

open OUT, ">$outfile" or die $!;
print OUT $intext;
close OUT;

# replaces ALL occurrences of orgtext with newtext and places the
number of occurences in $count




--------data sample. link to complete data above



<table width="100%" border="0" align="center" cellpadding="0"
cellspacing="0">
  <tr>
    <td width="24%" rowspan="2" valign="top"><table width="198"
border="0" align="center" cellpadding="1" cellspacing="0">
        <tr>
          <td><div align="center"><img src="images/ls_logo.gif"
width="192" height="91"></div></td>
        </tr>
        <tr>
          <td valign="top"><table width="200" border="0" align="center"
cellpadding="2" cellspacing="3">
              <tr>
                <td width="197" valign="top"><table width="100%"
border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                      <td><div align="center"><a
href="all-products.html"><img src="2005-menu/all-prods.gif" name="all"
width="177" height="33" border="0"></a></div></td>
                    </tr>
                    <tr>
                      <td><div align="center"><a
href="vitamins-supplements.html"><img src="2005-menu/vits-supl.gif"
name="vitamins" width="177" height="33" border="0"></a></div></td>
                    </tr>
                    <tr>
                      <td><div align="center"><a
href="liquid-supplements.html"><img src="2005-menu/liquid-vit.gif"
name="liquid" width="177" height="33" border="0"></a></div></td>
                    </tr>
                    <tr>
                      <td><div align="center"><a
href="body-building.html"><img src="2005-menu/body-build.gif"
name="bodybuild" width="177" height="33" border="0"></a></div></td>
                    </tr>
                    <tr>
                      <td><div align="center"><a
href="weightloss.html"><img src="2005-menu/diet.gif" name="diet"
width="177" height="33" border="0"></a></div></td>
                    </tr>
                    <tr>
                      <td><div align="center"><a
href="body-essentials.html"><img src="2005-menu/body-ess.gif"
name="bodyess" width="177" height="33" border="0"></a></div></td>
                    </tr>
                    <tr>
                      <td><div align="center"><a
href="articles.html"><img src="2005-menu/articles.gif" alt="Articles of
Interest" name="articles" width="177" height="33"
border="0"></a></div></td>
                    </tr>
                  </table></td>
              </tr>
              <tr>
                <td><div align="center">

                  </div></td>
              </tr>
              <tr>
                <td><div align="center"> <form method=POST
style="margin-bottom: 0"
action="https://www.linkpointcart.net/cgi-bin/cart.cgi">
                            <input type=hidden name="ViewCart"
value="ThreadsCart">
                            <input type=submit value="View Cart">
                          </form></div></td>
              </tr>
              <tr>
                <td><div align="center"><form method=POST
style="margin-bottom: 0"
action="https://www.linkpointcart.net/cgi-bin/cart.cgi">
	<input type=hidden name="CheckOut" value="Online">
	<input type=hidden name="CartID" value="ThreadsCart">
	<input type=submit value="Check Out">
</form></div></td>
              </tr>
              <tr>
                <td><table width="100%" border="0" cellspacing="0"
cellpadding="0">
                    <tr>
                      <td><br><div align="center"><a
href="catalog.html"><img src="2005-menu/catalog-banner.gif" width="196"
height="50" border="0"></a></div></td>
                    </tr>
                  </table>
                  <div align="center"><font size="2" face="Arial,
Helvetica, sans-serif"><strong><br>
                    We want to hear from you.<br>
                    Suggest a NEW PRODUCT!!<br>
                    <a href="suggest.htm">:: click
here::</a></strong></font></div></td>
              </tr>
            </table></td>
        </tr>
      </table></td>
    <td width="76%" height="28" valign="top"><div align="right"><img
src="2005-menu/top-image.gif" width="604" height="98" border="0"
usemap="#Map"></div></td>
  </tr>
  <tr>
    <td valign="top"><br> <!-- InstanceBeginEditable name="content" -->
      <table width="90%" border="0" align="center" cellpadding="1"
cellspacing="1">
        <tr>
          <td><table width="560" border="0" align="center"
cellpadding="3" cellspacing="0">
              <tr>
                <td rowspan="2" valign="top"><div align="center"><img
src="bottles/whey-chocolate-s.gif" width="102" height="150"
border="0"><br>
                    <font color="#666666" size="1" face="Arial,
Helvetica, sans-serif"></font></div></td>
                <td><div align="left"><font size="2" face="Arial,
Helvetica, sans-serif"><strong><font size="3">Whey
                    Protein<br>
                    Chocolate 3.3 lbs.</font><br>
                    54 grams of protein per serving<br>
                    <br>
                    </strong></font><font face="Verdana, Arial,
Helvetica, sans-serif"><strong><font size="3" face="Arial, Helvetica,
sans-serif">$
                    39.99</font></strong></font></div></td>
                <td rowspan="2" valign="top"><div align="center"><img
src="bottles/whey-vanilla-s.gif" width="102" height="150"
border="0"><br>
                  </div></td>
                <td><div align="left"><font size="2" face="Arial,
Helvetica, sans-serif"><strong><font size="3">Whey
                    Protein<br>
                    Vanilla </font><font size="2" face="Arial,
Helvetica, sans-serif"><strong><font size="3">3.3
                    lbs.</font></strong></font><br>
                    54 grams of protein per serving.<br>
                    <br>
                    </strong></font><font face="Verdana, Arial,
Helvetica, sans-serif"><strong><font size="3" face="Arial, Helvetica,
sans-serif">$
                    39.99</font></strong></font><font size="2"
face="Arial, Helvetica, sans-serif"><strong>
                    </strong></font></div></td>
              </tr>
              <tr>
                <td><form method="post"
action="https://www.linkpointcart.net/cgi-bin/cart.cgi">
                    <table border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td><font size="2" face="Arial, Helvetica,
sans-serif">Quantity:</font></td>
                        <td><font face="Verdana, Arial, Helvetica,
sans-serif">
                          <input type="text" name="VARQuantity"
value="1" size="4" />
                          </font></td>
                      </tr>
                      <tr>
                        <td colspan="2" align="center"> <font
face="Verdana, Arial, Helvetica, sans-serif">
                          <input type="hidden" name="VAR000" value="|"
/>
                          <input type="hidden" name="AddItem"
value="ThreadsCart|Lifesource Labs - Whey Protein Powder Chocolate
VAR000 $39.99|VARQuantity|||price5|||||||" />
                          <input name="submit" type="submit" value="Add
To Cart" />
                          </font></td>
                      </tr>
                    </table>
                  </form></td>
                <td><form method="post"
action="https://www.linkpointcart.net/cgi-bin/cart.cgi">
                    <table border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td><font size="2" face="Arial, Helvetica,
sans-serif">Quantity:</font></td>
                        <td><font face="Verdana, Arial, Helvetica,
sans-serif">
                          <input type="text" name="VARQuantity2"
value="1" size="4" />
                          </font></td>
                      </tr>
                      <tr>
                        <td colspan="2" align="center"> <font
face="Verdana, Arial, Helvetica, sans-serif">
                          <input type="hidden" name="VAR000" value="|"
/>
                          <input type="hidden" name="AddItem"
value="ThreadsCart|Lifesource Labs - Whey Protein Powder Vanilla VAR000
$39.99|VARQuantity|||price5|||||||" />
                          <input name="submit" type="submit" value="Add
To Cart" />
                          </font></td>
                      </tr>
                    </table>
                  </form></td>



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

Date: 13 Oct 2006 17:59:34 -0700
From: samiam@mytrashmail.com
Subject: Re: I have no problems eating cereal...after it softens. Why is replacing a simple string so hard then?
Message-Id: <1160787574.697851.42220@i3g2000cwc.googlegroups.com>

Okay, point taken: Using your suggestion, I saw some errors about
explicit package names and fixed that by declaring my opening variables
as local with "my"

My new code is still as useful as a no mouth dog at a frisbee contest:

use strict;
  use warnings;

print "hello world";
my $infile = 'C:\russ\weights\preg.htm';
my $outfile = 'C:\russ\weights\preg_clean.htm';

my $orgtext = "Whey";
my $newtext = "Popcorn";

undef $/; #slurp mode, read files in a whole

open IN, $infile or die $!;
my $intext = <IN>;
close IN;

#while ($intext) $intext = {s/$orgtext/$newtext/ms;}
# the ms is for coping correctly with newlines (that can easily appear
in a binary).
# else {print "something's up.";}

open OUT, ">$outfile" or die $!;
print OUT $intext;
close OUT;

# replaces ALL occurrences of orgtext with newtext and places the
number of occurences in $count

It gives no errors, but doesn't do anything. I change the "Whey" to
/Whey/ but no luck with error:

Use of uninitialized value in pattern match (m//) at
C:\russ\scripts\_Master_Snippets\preg.pl line 9.

After about 6 months more of study...I might be able to replace a
simple string. Dang!

L,
Sam




Mirco Wahab wrote:
> Thus spoke samiam@mytrashmail.com (on 2006-10-14 02:12):
>
> > In other areas of my life, like eating oatmeal and getting dressed, I
> > have no real problems. Some might even say I am a savant.
> >
> > But I am just beginning Perl, and things I think are easy turn out not
> > to me. Now, (said in Scarface voice) Let me introduce you to my lil'
> > friend!
> >
> > My task is sooo deceptively simple: Just replace a simple string with
> > another string. How hard could that be?
>
> Perl would have told you whats wrong if
> you had given it its chance; start your
> script with
>
>   use strict;
>   use warnings;
>
> and Perl will complain about
> 'unquoted stuff' or 'barewords'
> which it can't digest for now.
>
> Then, your program will magically work ...
>
> (... if you figure out that 'text strings'
> are 'quoted' by something)
> 
> Regards
> 
> Mirco



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

Date: Fri, 13 Oct 2006 20:13:51 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: I have no problems eating cereal...after it softens. Why is replacing a simple string so hard then?
Message-Id: <slrnej0eef.d2m.tadmc@magna.augustmail.com>

samiam@mytrashmail.com <samiam@mytrashmail.com> wrote:

> But I am just beginning Perl, 


Then you should probably ask for all the help that you can get.

Put

   use warnings;
   use strict;

at the top of every program you write, and perl will find
many of your bugs for you.


Have you read a basic tutorial such as "Learning Perl" yet?

See also http://learn.perl.org


> My task is sooo deceptively simple: Just replace a simple string with


(your strings are not as "simple" as you think.)


> another string. How hard could that be?
> 
> My data file is here: http://home.comcast.net/~tankomail/preg.htm
> And a sample is at the very bottom of this post. I just want to replace
> /<form[.*]?*\/form>/ with the word "block"


That is not a "simple string". That is markup. A robust solution
requires a Real Parser rather than a pattern match (which is only
good for a dirty hack).

Why did you include the square brackets?

They are not doing what you think they are doing.


> Basically I just want to replace all <form> </form> fields and
> everything in between with nothing, but in testing, I wanted to see my
> work so I chose the word "block" as a good simple substitute which I
> could then replace with nothing.


> $orgtext = Whey;  # this one right here


Is that a string with no quotes, or is that a function call?

You should put quotes around your strings. If you had a function
named Whey() defined, then it would be called here and its return
value would be stored in $orgtext.

"use strict" will enforce putting quotes around your strings.


> $newtext = Popcorn;
> 
> The above works. I reduced it to it's simplest form as a sanity check.
> Then I tried:
> 
> $orgtext = /[Ww]hey/;  # this one right here


"use warnings" would have helped you here. I expect you meant
this instead:

   $orgtext =~ /[Ww]hey/;
             ^
             ^

> $newtext = Popcorn;
> 
> But beyond the most primitive replacement, I invariably get:
> 
> Use of uninitialized value in pattern match (m//) at
> C:\russ\scripts\_Master_Snippets\clean_2_input_output_file.pl line 9.


Oh. You _are_ using warnings.

The uninitialized value is in $_.

Since you don't have a proper binding operator (=~) the pattern
is NOT attempting to match against the string in $orgtext, it
is trying to match the string in $_, and it appears you do not
have a string in there.

You inserted a bug, and "use warnings" found it for you!


> Eventually I want to try:
> 
> $orgtext = /<form[.*]?*\/form>/;  # this one right here
> $newtext = block;
> 
> But I can't get past the staring blocks. I know this code works in
> general, 


There is no way this code works. It has multiple errors in it.


> Any suggestions as to:
> 
> 1.) Is my basic model okay, slurping the whole file into a variable? or
> 2.) Should I use a while <> structure?


That depends on whether or not you need to match across multiple lines.

If you _need_ multiple lines then slurping is good, else line-by-line
is better.


> And even when I do get the simple Whey replaced with Popcorn - it only
> does the first instance, basically, I am guessing, because there is no
> iterative code in this script. 


You should read about the pattern match operator in perlop.pod if
you are having trouble using the pattern match operator.

It tells how to make a pattern find all occurrences.


> Your input and examples are GREATLY appreciated because the red spot on
> my banging against the cubicle wall head is growing.


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

my $html = get 'http://home.comcast.net/~tankomail/preg.htm';

$html =~ s#<form .*?</form>#BLOCK#sg;  # use alternate delimiters

print $html;
----------------------------


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sat, 14 Oct 2006 02:38:42 +0200
From: Mirco Wahab <wahab@chemie.uni-halle.de>
Subject: Re: I have no problems eating cereal...after it softens. Why is replacing a simple string so hard then?
Message-Id: <egpbr4$95k$1@mlucom4.urz.uni-halle.de>

Thus spoke samiam@mytrashmail.com (on 2006-10-14 02:12):

> In other areas of my life, like eating oatmeal and getting dressed, I
> have no real problems. Some might even say I am a savant.
> 
> But I am just beginning Perl, and things I think are easy turn out not
> to me. Now, (said in Scarface voice) Let me introduce you to my lil'
> friend!
> 
> My task is sooo deceptively simple: Just replace a simple string with
> another string. How hard could that be?

Perl would have told you whats wrong if
you had given it its chance; start your
script with

  use strict;
  use warnings;

and Perl will complain about
'unquoted stuff' or 'barewords'
which it can't digest for now.

Then, your program will magically work ...

(... if you figure out that 'text strings'
are 'quoted' by something)

Regards

Mirco


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

Date: Sat, 14 Oct 2006 04:48:22 +0200
From: Amelia <solitude.standing@silent-force.info>
Subject: Re: iPod Smart Playlist, iTunes, skip count, play count, synchronization
Message-Id: <solitude.standing-91B2CF.04481714102006@news.home.net.pl>

In article <haberg-1310062021210001@c83-250-192-69.bredband.comhem.se>,
 haberg@math.su.se (Hans Aberg) wrote:

> In article <solitude.standing-71A20F.19050413102006@news.home.net.pl>,
> Amelia <solitude.standing@silent-force.info> wrote:
> 
> >     We have two or more related questions. Experimenting with various
> >  Smart Playlists based on Smart Playlists discovered the "skip
> >  count" and related "last skipped" parameter. How do these relate
> >  to "play count" and "last played" song info? That is - when
> >  does a song feel "skipped" and when it's "played"?
> 
> According to my experimentation, a song adds to the play count when it
> plays to the end (not making any difference where in the track it
> started).

    And did you manage to guess or deduce similar value for "skipping"?
 AI is actually planning to write a XML parser in PERL that will
 interface to iTunes library like to a database or maybe use
 MySQL (though it would force user to install it and PERL is
 already installed with every Mac OS X copy) and then process
 it in any way I can think of - the AppleScript based solutions
 are much more easier to implement and probably safer, but so
 incredibly slow - I was only wondering if you know any program
 that is already doing this. I'm relearning PERL just for this
 task (I'm expert at regular expressions, just need a bit of
 refreshment) - even if it might not be used. I would use Tcl/Tk
 instead but it suffers from the same illness - it has to be
 installed and configured by the user before running the script.
 
 Right now, when you are using combined Smart Playlist, what
 you are really doing is the same thing - one playlist is
 fetching a set of songs according to some criteria, second
 one does the same, then the combined one does intersection
 or LEFT JOIN (SQL) of the sets. The only problem is it's 
 kind of slow and not very flexible - for example doesn't
 let you use regular expressions (RE or REGEX) and things
 like semantic rings - for example, I could make a gizmo
 that would let you search for songs that are related
 to word "love" by expanding the SQL query to synonyms
 (using RE and dictionary, say "love" -> "beloved" -> "sex"
 -> "shag" -> "aids" -> "red" -> "love") or using 
 FULLTEXT SEARCH on the song lyrics to assess the mood
 of the song (no magic here - mark a song as "sad" and
 all the words in lyrics will get an increased value of
 sadness, then if a song is related by FULLTEXT SEARCH
 to some other song, we know it contains enough "sad"
 words, when it triggers "sadness quotient" it is 
 classified as "sad" and in turn all the words in lyrics
 are gratified with more sadness. Same thing with other
 possible emotions or other entities you can think of.

    I wish iTunes 7 simply let me use regular expressions
 in the filters and SQL-like queries on the database that
 actually ALTER it. As I said - all those utilities you
 can find use AppleScript and are so slow it makes them
 unusable unless you own 4 x G5 machine or something...


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

Date: 13 Oct 2006 16:02:37 -0700
From: samiam@mytrashmail.com
Subject: Re: Primal Script/Komodo/ASE vs Ultra Edit users: With no built in debugger, what do you use to test your scripts?
Message-Id: <1160780557.803174.116380@b28g2000cwb.googlegroups.com>

Hi Scott,

Thanks for taking the time to help me out. I really appreciate it.
Also, thanks for your informative replies about my post and the
guidelines.

But didn't my post comprise a lot more than just the taboo question? If
90% of a post is kosher, isn't the 10% tolerable? I sure asked a lot
about IDE's and user experience with them and also IDE comparitive
questions. Why kick a pretty Prom Queen out of bed for a tiny mole when
by and large, the girl's alright?

L,
Sam

In the
Scott Bryce wrote:
> samiam@mytrashmail.com wrote:
>
> > Thanks for the F9 tip. Works great!  It opens a new window each
> > iteration - is this optional/configurable?
>
> I don't know. You could check the UE help file.
>
> > Do you prefer Komodo, Primal Script or UE?
>
> I have only used UE.
>
> > I say this to head off those who inevitably say,
> > "Try 'em and find out," which is cousin to, "Each person must decide
> > for themselves."
>
> We all have our own preferences.
>
> > Regarding off topic:
> >
> > Sorry...didin't realize it was off topic. Can you direct me to the
> > comp.lang.perl.misc.ide group? I can't seem to find it, hence my post
> > here.  I would have thought the "misc" in comp.lang.perl.misc would
> > have included Perl IDE's and comparing one to another, or asking
> > about Perl IDE recommendations.
>
> I won't try to decide if a discussion of Perl IDE's is on-topic or
> off-topic. What was off-topic is how to perform a specific task in UtraEdit.
>
> > Is discussion about Perl debuggers, IDE's and such precluded by the
> > group charter or FAQ?
>
> I don't believe so, but your question was about the functionality of a
> particular text editor that is not exclusive to Perl. The answer would
> have been the same if you were using UE to write code in some other
> scripting language.
>
>
> > Does the "misc" not mean miscellaneous but have an unspoken "code
> > only" subtext?
>
> The misc means that this group is for misc perl questions. Your question
> was about the functionality of a particular text editor that may or may
> not be used to write Perl scripts. You could have found the answer in
> the UE help file.
>
> There are posting guidelines posted to this group (clpm) twice a week.
> If you read the posting guidelines, you may get a better feel for what
> is or is not on-topic here.



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

Date: 13 Oct 2006 17:08:39 -0700
From: samiam@mytrashmail.com
Subject: Re: Primal Script/Komodo/ASE vs Ultra Edit users: With no built in debugger, what do you use to test your scripts?
Message-Id: <1160784519.657826.130910@k70g2000cwa.googlegroups.com>

Hey...you are alright in my book Scott :)

L,

Sam

PS. Do you post in rec.audio.pro?  I've definitely seen your sig
around...
Scott Bryce wrote:
> samiam@mytrashmail.com wrote:
>
> > But didn't my post comprise a lot more than just the taboo question?
>
> Yes, it did. A discussion of which Perl IDE one prefers is probably on
> topic. Since it is largely a matter of personal preference, you will
> have trouble getting a definitive answer here.
>
> My initial note about being off-topic had as much to do with my answer
> as your question. Since I was in a position to give a quick answer to
> the off-topic question, I did. No harm done, unless this turns out to be
> a long, drawn out thread about the ins and outs of UltraEdit.
>
> > If 90% of a post is kosher, isn't the 10% tolerable? I sure asked a
> > lot about IDE's and user experience with them and also IDE
> > comparitive questions. Why kick a pretty Prom Queen out of bed for a
> > tiny mole when by and large, the girl's alright?
>
> Well, you see, I'm married. Admiring the Prom Queen from a distance
> might be OK for a moment or two, but taking her to bed would be a problem.



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

Date: Fri, 13 Oct 2006 17:40:46 -0600
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: Primal Script/Komodo/ASE vs Ultra Edit users: With no built in debugger, what do you use to test your scripts?
Message-Id: <B6Gdnb2dDaWdua3YnZ2dnUVZ_vadnZ2d@comcast.com>

samiam@mytrashmail.com wrote:

> But didn't my post comprise a lot more than just the taboo question?

Yes, it did. A discussion of which Perl IDE one prefers is probably on 
topic. Since it is largely a matter of personal preference, you will 
have trouble getting a definitive answer here.

My initial note about being off-topic had as much to do with my answer 
as your question. Since I was in a position to give a quick answer to 
the off-topic question, I did. No harm done, unless this turns out to be 
a long, drawn out thread about the ins and outs of UltraEdit.

> If 90% of a post is kosher, isn't the 10% tolerable? I sure asked a
> lot about IDE's and user experience with them and also IDE
> comparitive questions. Why kick a pretty Prom Queen out of bed for a
> tiny mole when by and large, the girl's alright?

Well, you see, I'm married. Admiring the Prom Queen from a distance 
might be OK for a moment or two, but taking her to bed would be a problem.






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

Date: Sat, 14 Oct 2006 01:52:13 +0200
From: Mirco Wahab <wahab@chemie.uni-halle.de>
Subject: Re: Primal Script/Komodo/ASE vs Ultra Edit users: With no built in debugger, what do you use to test your scripts?
Message-Id: <egp93v$8aq$1@mlucom4.urz.uni-halle.de>

Thus spoke samiam@mytrashmail.com (on 2006-10-13 20:42):
> Primal Script/Komodo/ASE vs Ultra Edit users: With no built in
> debugger, what do you use to test your scripts?

For interactive debugging, I use almost all the time:

   OpenPerlIDE (on Windows) and
   ScITE (on Unix/Linux)

http://sourceforge.net/project/showfiles.php?group_id=23334&release_id=91440

Regards

Mirco



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

Date: Sat, 14 Oct 2006 01:28:16 GMT
From: Charles DeRykus <ced@blv-sam-01.ca.boeing.com>
Subject: Re: Probs with nested conditions
Message-Id: <J73qr2.9wH@news.boeing.com>

Michele Dondi wrote:
> On Fri, 13 Oct 2006 03:03:22 GMT, "Mumia W. (reading news)"
> <paduille.4059.mumia.w@earthlink.net> wrote:
> 
>>> if ( $ar{$ar}{loc} eq 'HBR'  and \
>> There's no need for the backslash.
> 
> There's no need for it and it will have a different semantic than it
> may possibly have in *sh programming, hence do something very
> different from what the OP actually expects...
> 

Very different :)

# perl -MO=Deparse
if ($x eq 'foo' and \
     $y == 2) {
    die 'foobar';
}
^D
if ($x eq 'foo' and \$y == 2) {
     die 'foobar';
}
- syntax OK

-- 
Charles DeRykus


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

Date: Fri, 13 Oct 2006 17:17:19 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: using the first variable on the command line inside a perl program
Message-Id: <slrnej043f.ce0.tadmc@magna.augustmail.com>

markpark <mark.leeds@morganstanley.com> wrote:

> I want to do something extremely simple but I can't get it to work and
> I've spent 3 hours so i think it's time to ask someone.


You are not working smart.

The *first* thing to do, even before spending 5 minutes programming it,
is to search the standard Perl docs for the answer that you need.


> i run my perl program by typing ( or in a shell script )
> 
> leedsmar/src/currency.pl   r_driver_file


> but i just cannot figure out how to do this
> in perl. i'm sure there must
> be a way.


Maybe there is a variable that contains the command line arguments?

Let's try looking for such a variable:

   perldoc perlvar

      The array @ARGV contains the command-line arguments...


Boy, that sure was easy!

Learn your way around the std docs, it is a huge time-saver.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 13 Oct 2006 23:21:32 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: using the first variable on the command line inside a perl program
Message-Id: <Xns985BBAC0EAB70castleamber@130.133.1.4>

"markpark" <mark.leeds@morganstanley.com> wrote:

> I want to do something extremely simple but I can't get it to work and
> I've spent 3 hours so i think it's time to ask someone.

Tip: buy "Learning Perl" and start reading it. You can't learn a language 
by trial and error. On your current course you will keep wasting time 
(also of others), and banging your head against the desk, the wall, and 
the keyboard.

It would amaze me if after having read Learning Perl for 3 hours you would 
have found the answer, and learned a lot.

The huge down side of trial and error programming is that people often 
lose track how they got to the solution. It's like walking randomly in a 
huge city and finding a shop by accident. Next time you want to go to that 
shop it will take you hours again.

-- 
John                Experienced Perl programmer: http://castleamber.com/

          Perl help, tutorials, and examples: http://johnbokma.com/perl/


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

Date: 13 Oct 2006 23:24:27 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: using the first variable on the command line inside a perl program
Message-Id: <Xns985BBB3F69713castleamber@130.133.1.4>

Tad McClellan <tadmc@augustmail.com> wrote:
 
> Learn your way around the std docs, it is a huge time-saver.

But 3 hours of heavy typing, banging your head against the keyboard, and 
looking very stressed appears more productive :-D

(I probably already told the story how at one time I was hired on-site, 
and I noticed (not that hard) that someone, while explaining something to 
me, was anxiously banging on the cursor keys, distracting me with the 
randomly moving cursor. When I asked why he did it he explained that this 
way the managers had the expression that we were working like crazy... )

-- 
John                Experienced Perl programmer: http://castleamber.com/

          Perl help, tutorials, and examples: http://johnbokma.com/perl/


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

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


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