Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: separating two sententences

by dreadpiratepeter (Priest)
on Sep 16, 2011 at 03:35 UTC ( #926296=note: print w/replies, xml ) Need Help??

in reply to separating two sententences

When you say "doesn't work" it tells us nothing. Try telling us what your expected output and actual output were.

For starters, I would add:

use strict; use warnings;
to your script make coding errors more obvious. and I would hazard a guess that you are not opening the file properly. checking the return code of the open would find that:
open IN,"<","file" or die "error opening file: $!";

"Worry is like a rocking chair. It gives you something to do, but it doesn't get you anywhere."

Replies are listed 'Best First'.
Re^2: separating two sententences
by Anonymous Monk on Sep 16, 2011 at 03:54 UTC

    thank you for your paying attention .i want to create an excel file that shows emails in one column and name in another column. 117nolasvegasnv Patrea 1800noda 188rivervalenj 199pittsburghpa 1advocare" Milos
      i want to create an excel file ...

      This tells us your ultimate goal, but does not describe what you expect the code of the OP to do and just what is going wrong. dreadpiratepeter was trying to get details of this kind.

      It seems that the OP code is a first attempt at reading the contents of a file and processing and printing the contents. This is a good first step to your final goal. As it stands, I can make a guess at what is happening. The regex  /("/w+/")/ has extraneous / (forward slash) characters in it that are interpreted as premature terminations of the regex (see muba's analysis below). Try something like this (untested):

      use warnings; use strict; my $filename = 'myfile'; open my $fh, '<', $filename or die "opening '$filename': $!"; while (<$fh>) { if (m{ ("\w+") }xms) { print "$1 \n"; } } close $fh;
      and you still have not told us what is not working. What happens when you run it? I spend all day with a QA department that thinks "doesn't work" is a legitimate bug report. I don't need it on the monks too ;)

      "Worry is like a rocking chair. It gives you something to do, but it doesn't get you anywhere."

        i am totally confused with regex doesnt recognize the word after ; and between " " and another question is email address.some of them start with numbers and some with alphabet.oooooooooh!!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://926296]
[perldigious]: A question since I'm ignorant of what's normal for database management... Do admins change column names a lot in databases?
[perldigious]: On occasion my scripts break, because they will do something that seems laregly pointless to me... like in this case, changing a column name from "ABC Category" to "ABC Category Override".
[perldigious]: Being the ignorant one, my initial reaction to that is, "that's sort of a dick move, a lot of people like me expect column names like that to stay the same, why the hell would you change them like that for seemingly no good reason?"
[perldigious]: Or is my irritation/ frustration well founded?
[Corion]: perldigious: That seems to be more the export and likely it's the recipients of that export that like the titles changes
[Corion]: ... "changed"
[Corion]: I usually expect fixed header names, but am sometimes lenient in the order of columns. But changing the report titles often sounds to me as if you are not the sole consument of the export ;)

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2017-05-25 13:31 GMT
Find Nodes?
    Voting Booth?