Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: How to Teach Perl to Scholars in the Humanities

by johndageek (Hermit)
on Jan 30, 2004 at 21:03 UTC ( #325396=note: print w/replies, xml ) Need Help??

in reply to How to Teach Perl to Scholars in the Humanities

Question, how do they search now?

Have them find particular text using their current method, then try one of the two below.

Of course perl needs to be on their box for the second one. But many people will gravitate toward something they are convinced is better/faster/easier than the way they are doing it now.

if they are using unix or cygwin try
grep -n text_to_search_for filename

#!/usr/bin/perl ## put your file name in below $your_file="file name goes here"; ## open in, "$your_file" or die "could not open $your_file\n"; ## loops through file while (<in>) { $line_count++; ## in the line below put the text to search for between the / and / print "$line_count - $_" if (/text to find/); }

Good luck, HTH!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://325396]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2016-10-27 23:51 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (372 votes). Check out past polls.