I'm new to perl, could someone explain to me exactly how this works
my($directory, $filename) = $text =~ m/(.*\/)(.*)$/;
print "D=$directory, F=$filename\n";
The first line is the confusing line, how does the grep line work and then pass it along to $text and my($directory, $filename).
Also, what does the "my" part do. And what does the "m" part on the grep section do
Yeah it does work, I've tested it, but exactly what part separates the line to the directory and file name and how does it know where to separate it.
martin, why do you even bother coming my question to tell my to read the manual. It's not like this is a ubiquitous piece of code I could find the answer googling. Your answer was less than worthless
I need to know how $text =~ m/(.*\/)(.*)$/; passes the filename and path name to $text. It doesn't make sense that a match operator and equivalence test will pass two separate pieces of information into a scalar. And it doesn't make sense that a scalar, $text will be broken down further in my($directory, $filename) =$text