#!/usr/bin/perl while ( defined($line = <STDIN>) ) { chomp $line; $line =~ s/^\#.*$//; # Remove comments if ( $line =~ /^\s*(\S+)\s+(\S+)/ ) { $pin = $1; $signal = $2; print "set_location_assignment PIN_\U${pin}\E -to \"${signal}\"\n"; } }