in reply to spliting large file into smaller

As mentioned, there is a unix split command:
user@host ~$] split -l 30 bigfile.txt
Can also do this in a perl oneliner (warning -- this one is very inefficient):
perl -ne 'open FILE, ">>", "smallfile".int($./30).".txt"; print FILE $ +_; close FILE }' bigfile.txt
Take a look at the $. entry in perlvar.