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

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!
dageek

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2016-07-26 04:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (231 votes). Check out past polls.