I'm not sure what you mean by "commit", are you doing some database work? The following is a very basic example for (one way of) checking for spaces within strings:
#!/usr/bin/perl use strict; use warnings; my $path; $path = "/usr/bin"; #$path = "/usr/bin foo"; # uncomment for testing if ( $path =~ /\s/){ print "String $path contains a space character.\n"; }else{ print "String $path does not contain a space character.\n"; }
See perlrequick.
In reply to Re: perl script to disallow spaces in file or dir name
by marto
in thread perl script to disallow spaces in file or dir name
by siddhu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |