Re: Searching in a line



lerameur wrote:
On Aug 30, 8:28 am, "Jürgen Exner" <jurge...@xxxxxxxxxxx> wrote:
lerameur wrote:
my $log = 'file.txt';
open my $fh, '<', $log or die "cannot open '$log': $!\n";
while (<$fh>) {

my $val =(split( /,/,$log))[3]
print $val, "\n";

BUt there is no output, when I type >./program_name.pl
it skips two lines and returns to the prompt.

That's odd. You should at least have gotten a warning that $val is
undefined. Aren't you using warnings and strict?

Anyway, you are splitting $log which just contains 'file.txt'. Nothing to
split on a comma there. Use $_ instead.

Oh, and BTW: we heard you the first time. No need to flood the NG with a
dozen identical posts.

Oh, and BTW2:
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

jue


.



Relevant Pages

  • Re: SW File Permissions
    ... Yet I can make changes to dimensions, features, etc.. ... Changes to dimensions results in a warning "that it is read-only" and ... that any changes I make will be lost unless I do a saveas. ... ignore the prompt, fill in new value and part/assembly are updated ...
    (comp.cad.solidworks)
  • Re: Warning after making changes
    ... the Save button that warning will not appear anymore of course. ... Dim blIgnoreWarning as Boolean ... 'If the form was not explicitly saved, prompt the user ... lngRet = MsgBox("Data Was Changed. ...
    (microsoft.public.access.reports)
  • Re: Recovering from temp directory
    ... if you want to "Open it" or "Save it to disk". ... So let's suppose Microsoft created a message when opening a document ... in the Temp folder without warning. ... There should be a prompt in this ...
    (microsoft.public.word.application.errors)
  • Required Fields and Warning Boxes
    ... warning box to appear asking the user "are you sure you want to make ... field and shows the confirmation box but the information in the form ... Second Script: When I create a separate function with "are you sure ... it does not prompt me to complete the email field. ...
    (comp.lang.javascript)
  • Re: Best way to cancel out of a data entry form?
    ... You can turn the warning off with: ... DoCmd.DoMenuItem acFormBar, acEditMenu, 8,, acMenuVer70 ... to change the prompt to 'are you sure you want to cancel'? ...
    (microsoft.public.access.forms)