Ben
Conrad wrote, on Tue 2/15/2005 15:00:
: This works and gives me the first 3 chars of my string:
: ($hoststr) = $hostname =~ /(^\D{3})/;
:
: Is it possible to do this so I can make the length of the repeating pattern
: a variable? It's not working for me.
: $length = 4;
: ($hoststr) = $hostname =~ /(^\D{\$length})/;
: This works and gives me the first 3 chars of my string:
: ($hoststr) = $hostname =~ /(^\D{3})/;
:
: Is it possible to do this so I can make the length of the repeating pattern
: a variable? It's not working for me.
: $length = 4;
: ($hoststr) = $hostname =~ /(^\D{\$length})/;
Works for me if I
don't escape the $ in $length.
Good luck,
Joe
==============================================================
Joseph P. Discenza, Sr. Programmer/Analyst
mailto:[EMAIL PROTECTED]
Carleton Inc. http://www.carletoninc.com
574.243.6040 ext. 300 fax: 574.243.6060
Providing Financial Solutions and Compliance for over 30 Years
_______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs