Whoops:
that should be:
$case{'judges'} =~ s/\n/ /g;
not
$case{'judges'} =~ s/\n/ /;
But same transposed result as before.
Thanks
Michael
User Profile
Collapse
-
Thanks for your help but I still am apparently breaking Perl. I tried your test and yes, it works. But when I try to apply it to my script, all hell breaks lose. At its most basic, this is my script:
[code=perl]
#!/usr/bin/perl -w
my %case = (); # case hash
my $judges = ''; # temp key
open (IN, "/Users/MicWood/Documents/Perl/Opinion\ Scripts/output.txt");
$/="";...Leave a comment:
-
I should also note that once i have isolated the entire string (with embedded "\n") to a hash value, say $case{'judges'} for example, and i try the following after the while (<>) loop:
if (exists $case{'judges'} ){
$case{'judges'} =~s/\n//g;}
i get the following when i try to print $case{'judges'} :
Justice Hudthis case.t participate in the consideration or decision of
...Leave a comment:
-
I have a simpler Perl question, but chomp doesn't seem to be doing the trick.
I've input a file in paragraph mode (ie set $/="") as much of the data i need to isolate is multi-line. I have set up a while (<>) loop, in which I have several if statements to pattern match. I am saving long text strings into a hash but I need the values not to have any embedded "/n", such as:
Justice Hudson did...Leave a comment:
No activity results to display
Show More
Leave a comment: