User Profile

Collapse

Profile Sidebar

Collapse
watcher00
watcher00
Last Activity: Mar 11 '07, 10:00 PM
Joined: Mar 6 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • watcher00
    started a topic Printing a pound sign £
    in Perl

    Printing a pound sign £

    every time i try to print "£" i get "ú" instead

    This
    Code:
    print("£");
    produces ú rather than £

    how can i change this?
    See more | Go to post

  • Thanks a lot guys for your help, as i'm still learning perl, i'm not too sure how exactly this line of code works:

    Code:
    $count{$mark} = () = $text =~ m/(\Q$mark\E)/g
    specifically, why does the " = () = " part need to be in there, what does it do?
    See more | Go to post

    Leave a comment:


  • Thanks guys

    here is what i've come up with, would appreciate any comments and suggestions.

    Code:
    #!c:/Perl/bin/perl.exe
    
    print("Please type in the file name\n");
    $file= <STDIN>;
    open(FILE, "$file") || die "Couldn't open file: $!";
    
    
    $text  = join(//,<FILE>);
    @marks = ( '!', '"', '\'', '\(', '\)', ',', '-', '\.', '/', ':',
    ...
    See more | Go to post

    Leave a comment:


  • watcher00
    started a topic Counting Punctuation Characters in a text file
    in Perl

    Counting Punctuation Characters in a text file

    Hi

    I'm a complete newbie at Perl and i was wondering if i can get some help completing an exercise i've come across.

    I need to count the punctuation marks from a text file and then output a list of all occurring punctuation marks with its frequency printed next to it.

    eg

    2 hyphens
    3 commas
    4 periods
    etc
    etc

    Not even sure where to begin, the exercise...
    See more | Go to post
No activity results to display
Show More
Working...